mirror of
https://github.com/GSA/notifications-api.git
synced 2026-01-30 06:21:50 -05:00
Simplify argument passing in apply_async
This avoids the need to keep in-sync with any future changes to the signature, and reduces the amount of irrelevant code to read.
This commit is contained in:
@@ -89,15 +89,7 @@ def test_apply_async_injects_global_request_id_into_kwargs(mocker, celery_task):
|
||||
super_apply = mocker.patch('celery.app.task.Task.apply_async')
|
||||
g.request_id = '1234'
|
||||
celery_task.apply_async()
|
||||
|
||||
super_apply.assert_called_with(
|
||||
None,
|
||||
{'request_id': '1234'},
|
||||
None,
|
||||
None,
|
||||
None,
|
||||
None
|
||||
)
|
||||
super_apply.assert_called_with(kwargs={'request_id': '1234'})
|
||||
|
||||
|
||||
def test_apply_async_injects_id_into_kwargs_from_request(mocker, notify_api, celery_task):
|
||||
@@ -108,11 +100,4 @@ def test_apply_async_injects_id_into_kwargs_from_request(mocker, notify_api, cel
|
||||
with notify_api.test_request_context(headers=request_headers):
|
||||
celery_task.apply_async()
|
||||
|
||||
super_apply.assert_called_with(
|
||||
None,
|
||||
{'request_id': '1234'},
|
||||
None,
|
||||
None,
|
||||
None,
|
||||
None
|
||||
)
|
||||
super_apply.assert_called_with(kwargs={'request_id': '1234'})
|
||||
|
||||
Reference in New Issue
Block a user