Fixed bug with deleting the 'delivered' notifications.

This commit is contained in:
Nicholas Staples
2016-04-13 12:49:38 +01:00
parent cf883ed339
commit 7fa33a52a9
2 changed files with 5 additions and 3 deletions

View File

@@ -45,14 +45,16 @@ mmg_error = {'Error': '40', 'Description': 'error'}
def test_should_call_delete_notifications_more_than_week_in_task(notify_api, mocker):
mocker.patch('app.celery.tasks.delete_notifications_created_more_than_a_week_ago')
mocked = mocker.patch('app.celery.tasks.delete_notifications_created_more_than_a_week_ago')
delete_successful_notifications()
assert mocked.assert_called_with('delivered')
assert tasks.delete_notifications_created_more_than_a_week_ago.call_count == 1
def test_should_call_delete_notifications_more_than_week_in_task(notify_api, mocker):
mocker.patch('app.celery.tasks.delete_notifications_created_more_than_a_week_ago')
mocked = mocker.patch('app.celery.tasks.delete_notifications_created_more_than_a_week_ago')
delete_failed_notifications()
mocked.assert_called_with('failed')
assert tasks.delete_notifications_created_more_than_a_week_ago.call_count == 1