diff --git a/app/celery/nightly_tasks.py b/app/celery/nightly_tasks.py index ca48955f0..77ca1debb 100644 --- a/app/celery/nightly_tasks.py +++ b/app/celery/nightly_tasks.py @@ -266,11 +266,6 @@ def get_letter_notifications_still_sending_when_they_shouldnt_be(): func.date(Notification.sent_at) <= expected_sent_date ) - if today.isoweekday() in {2, 4}: # on tue, thu, we only care about first class letters - q = q.filter( - Notification.postage == 'first' - ) - return q.count(), expected_sent_date diff --git a/tests/app/celery/test_nightly_tasks.py b/tests/app/celery/test_nightly_tasks.py index 30e1f583c..9a7bf613c 100644 --- a/tests/app/celery/test_nightly_tasks.py +++ b/tests/app/celery/test_nightly_tasks.py @@ -371,11 +371,12 @@ def test_get_letter_notifications_still_sending_when_they_shouldnt_finds_thursda ): thursday = datetime(2018, 1, 11, 13, 30) yesterday = datetime(2018, 1, 14, 13, 30) + create_notification(template=sample_letter_template, status='sending', sent_at=thursday, postage='first') create_notification(template=sample_letter_template, status='sending', sent_at=thursday, postage='second') create_notification(template=sample_letter_template, status='sending', sent_at=yesterday, postage='second') count, expected_sent_date = get_letter_notifications_still_sending_when_they_shouldnt_be() - assert count == 1 + assert count == 2 assert expected_sent_date == date(2018, 1, 11) @@ -386,12 +387,11 @@ def test_get_letter_notifications_still_sending_when_they_shouldnt_finds_friday_ friday = datetime(2018, 1, 12, 13, 30) yesterday = datetime(2018, 1, 14, 13, 30) create_notification(template=sample_letter_template, status='sending', sent_at=friday, postage='first') - create_notification(template=sample_letter_template, status='sending', sent_at=yesterday, postage='first') - # doesn't get reported because it's second class, and it's tuesday today create_notification(template=sample_letter_template, status='sending', sent_at=friday, postage='second') + create_notification(template=sample_letter_template, status='sending', sent_at=yesterday, postage='first') count, expected_sent_date = get_letter_notifications_still_sending_when_they_shouldnt_be() - assert count == 1 + assert count == 2 assert expected_sent_date == date(2018, 1, 12)