From 584f849a3d703c5e67699be096081e5c9eec533e Mon Sep 17 00:00:00 2001 From: Chris Hill Scott Date: Tue, 4 Jul 2017 09:32:09 +0100 Subject: [PATCH] =?UTF-8?q?Don=E2=80=99t=20link=20to=20template=20in=20tou?= =?UTF-8?q?r?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We want people to go to the dashboard, not get distracted by clicking the tempting blue link. --- .../views/notifications/notification.html | 6 ++++- tests/app/main/views/test_notifications.py | 22 ++++++++++++++++++- 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/app/templates/views/notifications/notification.html b/app/templates/views/notifications/notification.html index aba8beee4..4cba2923b 100644 --- a/app/templates/views/notifications/notification.html +++ b/app/templates/views/notifications/notification.html @@ -15,7 +15,11 @@

- {{ template.name }} + {% if help %} + {{ template.name }} + {% else %} + {{ template.name }} + {% endif %} sent {% if job and job.original_file_name != 'Report' %} from diff --git a/tests/app/main/views/test_notifications.py b/tests/app/main/views/test_notifications.py index f318de260..6b7b8bb69 100644 --- a/tests/app/main/views/test_notifications.py +++ b/tests/app/main/views/test_notifications.py @@ -9,7 +9,7 @@ from app.utils import ( ) from tests.app.test_utils import normalize_spaces -from tests.conftest import mock_get_notification +from tests.conftest import mock_get_notification, SERVICE_ONE_ID @pytest.mark.parametrize('notification_status, expected_status', [ @@ -91,3 +91,23 @@ def test_notification_status_page_respects_redaction( service_one['id'], fake_uuid, ) + + +@freeze_time("2012-01-01 01:01") +def test_notification_page_doesnt_link_to_template_in_tour( + client_request, + fake_uuid, + mock_get_notification, +): + + page = client_request.get( + 'main.view_notification', + service_id=SERVICE_ONE_ID, + notification_id=fake_uuid, + help=3, + ) + + assert normalize_spaces(page.select('main p:nth-of-type(1)')[0].text) == ( + 'sample template sent by Test User on 1 January at 1:01am' + ) + assert len(page.select('main p:nth-of-type(1) a')) == 0