diff --git a/app/main/views/service_settings.py b/app/main/views/service_settings.py index 6ed2a90f6..272a171a0 100644 --- a/app/main/views/service_settings.py +++ b/app/main/views/service_settings.py @@ -481,7 +481,7 @@ def get_service_verify_reply_to_address_partials(service_id, notification_id): created_at_no_tz = notification["created_at"][:-6] seconds_since_sending = (datetime.utcnow() - datetime.strptime(created_at_no_tz, '%Y-%m-%dT%H:%M:%S.%f')).seconds if notification["status"] in FAILURE_STATUSES or ( - notification["status"] in SENDING_STATUSES and seconds_since_sending > 90 + notification["status"] in SENDING_STATUSES and seconds_since_sending > 45 ): verification_status = "failure" form.email_address.data = notification['to'] diff --git a/tests/app/main/views/test_service_settings.py b/tests/app/main/views/test_service_settings.py index fa3cb7ec9..0bb1af038 100644 --- a/tests/app/main/views/test_service_settings.py +++ b/tests/app/main/views/test_service_settings.py @@ -2088,7 +2088,7 @@ def test_service_verify_reply_to_address( @freeze_time("2018-06-01 11:11:00.061258") -def test_add_reply_to_email_address_fails_if_notification_not_delivered_in_5_mins(mocker, client_request, fake_uuid): +def test_add_reply_to_email_address_fails_if_notification_not_delivered_in_45_sec(mocker, client_request, fake_uuid): notification = { "id": fake_uuid, "status": "sending", @@ -2096,7 +2096,7 @@ def test_add_reply_to_email_address_fails_if_notification_not_delivered_in_5_min "service_id": SERVICE_ONE_ID, "template_id": TEMPLATE_ONE_ID, "notification_type": "email", - "created_at": '2018-06-01T11:05:52.499230+00:00' + "created_at": '2018-06-01T11:10:12.499230+00:00' } mocker.patch( 'app.service_api_client.get_reply_to_email_addresses', return_value=[] @@ -2112,7 +2112,6 @@ def test_add_reply_to_email_address_fails_if_notification_not_delivered_in_5_min expected_banner = page.find_all('div', class_='banner-dangerous')[0] assert 'There’s a problem with your reply-to address' in expected_banner.text.strip() mock_add_reply_to_email_address.assert_not_called() - # add check that form is visible @pytest.mark.parametrize('fixture, data, api_default_args', [