From 272c6a3c919ffb72f032843605eb3817fbf1537d Mon Sep 17 00:00:00 2001 From: Tom Byers Date: Tue, 12 Nov 2019 17:06:06 +0000 Subject: [PATCH] Update tests with new error message content --- tests/app/main/test_errorhandlers.py | 4 ++-- tests/app/main/views/accounts/test_choose_accounts.py | 4 ++-- tests/app/main/views/test_accept_invite.py | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/app/main/test_errorhandlers.py b/tests/app/main/test_errorhandlers.py index 1b36bcbbc..aecff59aa 100644 --- a/tests/app/main/test_errorhandlers.py +++ b/tests/app/main/test_errorhandlers.py @@ -9,7 +9,7 @@ def test_bad_url_returns_page_not_found(client): response = client.get('/bad_url') assert response.status_code == 404 page = BeautifulSoup(response.data.decode('utf-8'), 'html.parser') - assert page.h1.string.strip() == 'Page could not be found' + assert page.h1.string.strip() == 'Page not found' def test_load_service_before_request_handles_404(client_request, mocker): @@ -35,7 +35,7 @@ def test_malformed_token_returns_page_not_found(logged_in_client, url): assert response.status_code == 404 page = BeautifulSoup(response.data.decode('utf-8'), 'html.parser') - assert page.h1.string.strip() == 'Page could not be found' + assert page.h1.string.strip() == 'Page not found' flash_banner = page.find('div', class_='banner-dangerous').string.strip() assert flash_banner == "There’s something wrong with the link you’ve used." diff --git a/tests/app/main/views/accounts/test_choose_accounts.py b/tests/app/main/views/accounts/test_choose_accounts.py index bc3c3b69b..7024ff34c 100644 --- a/tests/app/main/views/accounts/test_choose_accounts.py +++ b/tests/app/main/views/accounts/test_choose_accounts.py @@ -247,8 +247,8 @@ def test_choose_account_should_not_show_back_to_service_link_if_service_archived )), (service_two, 403, ( # Page has no ‘back to’ link - '403 ' - 'You do not have permission to view this page.' + 'You are not allowed to see this page ' + 'To check your permissions, speak to a member of your team who can manage settings, team and usage.' )), )) def test_should_not_show_back_to_service_if_user_doesnt_belong_to_service( diff --git a/tests/app/main/views/test_accept_invite.py b/tests/app/main/views/test_accept_invite.py index c1bc31804..e46e7a83f 100644 --- a/tests/app/main/views/test_accept_invite.py +++ b/tests/app/main/views/test_accept_invite.py @@ -415,7 +415,7 @@ def test_signed_in_existing_user_cannot_use_anothers_invite( _follow_redirects=True, _expected_status=403, ) - assert page.h1.string.strip() == '403' + assert page.h1.string.strip() == 'You are not allowed to see this page' flash_banners = page.find_all('div', class_='banner-dangerous') assert len(flash_banners) == 1 banner_contents = flash_banners[0].text.strip()