Indicate messages sent with a test key

If a message has been sent with a test key it’s a bit confusing to just
say ‘Delivered’ on the page, because it hasn’t gone to anyone’s phone.

So this commit adds a bit of hint text to disambiguate what ‘Delivered’
actually means in this context.
This commit is contained in:
Chris Hill-Scott
2018-09-06 10:41:59 +01:00
parent 2ddf3d5cfe
commit e4341f5d5b
4 changed files with 28 additions and 11 deletions

View File

@@ -16,14 +16,19 @@ from tests.conftest import (
)
@pytest.mark.parametrize('notification_status, expected_status', [
('created', 'Sending'),
('sending', 'Sending'),
('delivered', 'Delivered'),
('failed', 'Failed'),
('temporary-failure', 'Phone not accepting messages right now'),
('permanent-failure', 'Phone number doesnt exist'),
('technical-failure', 'Technical failure'),
@pytest.mark.parametrize('key_type, notification_status, expected_status', [
(None, 'created', 'Sending'),
(None, 'sending', 'Sending'),
(None, 'delivered', 'Delivered'),
(None, 'failed', 'Failed'),
(None, 'temporary-failure', 'Phone not accepting messages right now'),
(None, 'permanent-failure', 'Phone number doesnt exist'),
(None, 'technical-failure', 'Technical failure'),
('team', 'delivered', 'Delivered'),
('live', 'delivered', 'Delivered'),
('test', 'sending', 'Sending (test)'),
('test', 'delivered', 'Delivered (test)'),
('test', 'permanent-failure', 'Phone number doesnt exist (test)'),
])
@pytest.mark.parametrize('user', [
active_user_with_permissions,
@@ -37,6 +42,7 @@ def test_notification_status_page_shows_details(
service_one,
fake_uuid,
user,
key_type,
notification_status,
expected_status,
):
@@ -46,7 +52,8 @@ def test_notification_status_page_shows_details(
_mock_get_notification = mock_get_notification(
mocker,
fake_uuid,
notification_status=notification_status
notification_status=notification_status,
key_type=key_type,
)
page = client_request.get(