diff --git a/tests/app/v2/notifications/test_get_notifications.py b/tests/app/v2/notifications/test_get_notifications.py index 351b2c82f..814e6dd6c 100644 --- a/tests/app/v2/notifications/test_get_notifications.py +++ b/tests/app/v2/notifications/test_get_notifications.py @@ -9,6 +9,11 @@ from tests.app.db import ( create_template, create_service) +from tests.app.conftest import ( + sample_notification, + sample_email_notification, +) + @pytest.mark.parametrize('billable_units, provider', [ (1, 'mmg'), @@ -233,6 +238,26 @@ def test_get_notification_adds_delivery_estimate_for_letters( assert json_response['estimated_delivery'] == estimated_delivery +@pytest.mark.parametrize('notification_mock', [ + sample_notification, + sample_email_notification, +]) +def test_get_notification_doesnt_have_delivery_estimate_for_non_letters( + client, + notify_db, + notify_db_session, + notification_mock, +): + mocked_notification = notification_mock(notify_db, notify_db_session) + auth_header = create_authorization_header(service_id=mocked_notification.service_id) + response = client.get( + path='/v2/notifications/{}'.format(mocked_notification.id), + headers=[('Content-Type', 'application/json'), auth_header] + ) + assert response.status_code == 200 + assert 'estimated_delivery' not in json.loads(response.get_data(as_text=True)) + + def test_get_all_notifications_returns_200(client, sample_template): notifications = [create_notification(template=sample_template) for _ in range(2)] notification = notifications[-1]