Merge branch 'master' into fix-delete-s3

This commit is contained in:
Rebecca Law
2018-08-13 11:44:44 +01:00
2 changed files with 25 additions and 14 deletions

View File

@@ -176,6 +176,16 @@ def test_delete_notifications_delete_notification_type_for_default_time_if_no_da
assert len(Notification.query.filter_by(notification_type='email').all()) == 1
def test_delete_notifications_does_try_to_delete_from_s3_when_letter_has_not_been_sent(sample_service, mocker):
mock_get_s3 = mocker.patch("app.dao.notifications_dao.get_s3_bucket_objects")
letter_template = create_template(service=sample_service, template_type='letter')
create_notification(template=letter_template, status='sending',
reference='LETTER_REF')
delete_notifications_created_more_than_a_week_ago_by_type('email')
mock_get_s3.assert_not_called()
def _create_templates(sample_service):
email_template = create_template(service=sample_service, template_type='email')
sms_template = create_template(service=sample_service)