Successful notifications are deleted after a week now. All tests passing.

This commit is contained in:
Nicholas Staples
2016-04-05 11:07:21 +01:00
parent e465dc8bc4
commit 4d15409781
4 changed files with 21 additions and 22 deletions

View File

@@ -46,16 +46,16 @@ def firetext_error():
return {'code': 0, 'description': 'error'}
def test_should_call_delete_successful_notifications_in_task(notify_api, mocker):
mocker.patch('app.celery.tasks.delete_successful_notifications_created_more_than_a_day_ago')
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')
delete_successful_notifications()
assert tasks.delete_successful_notifications_created_more_than_a_day_ago.call_count == 1
assert tasks.delete_notifications_created_more_than_a_week_ago.call_count == 1
def test_should_call_delete_failed_notifications_in_task(notify_api, mocker):
mocker.patch('app.celery.tasks.delete_failed_notifications_created_more_than_a_week_ago')
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')
delete_failed_notifications()
assert tasks.delete_failed_notifications_created_more_than_a_week_ago.call_count == 1
assert tasks.delete_notifications_created_more_than_a_week_ago.call_count == 1
def test_should_call_delete_codes_on_delete_verify_codes_task(notify_api, mocker):