@test.create_stubs({api.sahara: ('job_binary_list',
                                     'job_binary_get',
                                     'job_binary_internal_delete',
                                     'job_binary_delete',)})
    def test_delete(self):
        jb_list = (api.sahara.job_binary_list(IsA(http.HttpRequest))
                   .AndReturn(self.job_binaries.list()))
        api.sahara.job_binary_get(IsA(http.HttpRequest), IsA(unicode)) \
            .AndReturn(self.job_binaries.list()[0])
        api.sahara.job_binary_delete(IsA(http.HttpRequest), jb_list[0].id)
        int_id = jb_list[0].url.split("//")[1]
        api.sahara.job_binary_internal_delete(IsA(http.HttpRequest), int_id)
        self.mox.ReplayAll()
        form_data = {"action": "job_binaries__delete__%s" % jb_list[0].id}
        res = self.client.post(INDEX_URL, form_data)
        self.assertRedirectsNoFollow(res, INDEX_URL)
dataset/ETHPy150Open CiscoSystems/avos/openstack_dashboard/dashboards/project/data_processing/job_binaries/tests.py/DataProcessingJobBinaryTests.test_delete/original