mirror of
https://github.com/ansible/awx.git
synced 2026-01-28 23:04:41 -03:30
remove unnecessary mock
This commit is contained in:
parent
69eccd3130
commit
66108164b9
@ -103,17 +103,15 @@ def test_block_unprocessed_events(delete, admin_user, mocker):
|
||||
class MockView(UnifiedJobDeletionMixin):
|
||||
model = Job
|
||||
|
||||
def get_object():
|
||||
def get_object(self):
|
||||
return job
|
||||
|
||||
view = MockView()
|
||||
|
||||
time_of_request = time_of_finish + relativedelta(seconds=2)
|
||||
with mock.patch('awx.api.views.now', lambda: time_of_request):
|
||||
with mock.patch.object(view, 'get_object') as get_obj:
|
||||
get_obj.return_value = job
|
||||
r = view.destroy(request)
|
||||
assert r.status_code == 400
|
||||
r = view.destroy(request)
|
||||
assert r.status_code == 400
|
||||
|
||||
|
||||
@pytest.mark.django_db
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user