Merge pull request #3953 from alphagov/show_exceeded_daily_limit_on_page

Show status when job has exceeded the daily sending limit
This commit is contained in:
Rebecca Law
2021-07-15 16:03:19 +01:00
committed by GitHub
3 changed files with 46 additions and 1 deletions

View File

@@ -221,6 +221,30 @@ def test_should_show_job_without_notifications(
assert page.select_one('tbody').text.strip() == 'No messages to show yet…'
def test_should_show_job_with_sending_limit_exceeded_status(
client_request,
service_one,
active_user_with_permissions,
mock_get_service_template,
mock_get_job_with_sending_limits_exceeded,
mock_get_notifications_with_no_notifications,
mock_get_service_data_retention,
fake_uuid,
):
page = client_request.get(
'main.view_job',
service_id=service_one['id'],
job_id=fake_uuid,
)
assert normalize_spaces(page.select('main p')[1].text) == (
"Notify cannot send these messages because you have reached your daily limit. You can only send 1,000 messages per day." # noqa
)
assert normalize_spaces(page.select('main p')[2].text) == (
"Upload this spreadsheet again tomorrow or contact the GOV.UK Notify team to raise the limit."
)
@freeze_time("2020-01-10 1:0:0")
@pytest.mark.parametrize('created_at, processing_started, expected_message', (
# Recently created, not yet started