mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-16 20:49:00 -04:00
Merge pull request #2858 from alphagov/features-content-updates
Update features and footer content and answer some common support questions.
This commit is contained in:
@@ -77,7 +77,7 @@ def test_robots(client):
|
||||
|
||||
|
||||
@pytest.mark.parametrize('view', [
|
||||
'cookies', 'privacy', 'using_notify', 'pricing', 'terms', 'roadmap',
|
||||
'cookies', 'privacy', 'pricing', 'terms', 'roadmap',
|
||||
'features', 'callbacks', 'documentation', 'security'
|
||||
])
|
||||
def test_static_pages(
|
||||
@@ -89,26 +89,6 @@ def test_static_pages(
|
||||
assert not page.select_one('meta[name=description]')
|
||||
|
||||
|
||||
@pytest.mark.parametrize('view, expected_anchor', [
|
||||
('delivery_and_failure', 'messagedeliveryandfailure'),
|
||||
('trial_mode', 'trial-mode'),
|
||||
])
|
||||
def test_old_static_pages_redirect_to_using_notify_with_anchor(
|
||||
client_request,
|
||||
view,
|
||||
expected_anchor,
|
||||
):
|
||||
client_request.get(
|
||||
'main.{}'.format(view),
|
||||
_expected_status=301,
|
||||
_expected_redirect=url_for(
|
||||
'main.using_notify',
|
||||
_anchor=expected_anchor,
|
||||
_external=True
|
||||
),
|
||||
)
|
||||
|
||||
|
||||
@pytest.mark.parametrize('view, expected_view', [
|
||||
('information_risk_management', 'security'),
|
||||
('old_integration_testing', 'integration_testing'),
|
||||
@@ -117,6 +97,7 @@ def test_old_static_pages_redirect_to_using_notify_with_anchor(
|
||||
('old_terms', 'terms'),
|
||||
('information_security', 'using_notify'),
|
||||
('old_using_notify', 'using_notify'),
|
||||
('delivery_and_failure', 'message_status'),
|
||||
])
|
||||
def test_old_static_pages_redirect(
|
||||
client,
|
||||
@@ -131,6 +112,10 @@ def test_old_static_pages_redirect(
|
||||
)
|
||||
|
||||
|
||||
def test_old_using_notify_page(client_request):
|
||||
client_request.get('main.using_notify', _expected_status=410)
|
||||
|
||||
|
||||
def test_old_integration_testing_page(
|
||||
client_request,
|
||||
):
|
||||
@@ -162,29 +147,11 @@ def test_terms_is_generic_if_user_is_not_logged_in(
|
||||
)
|
||||
|
||||
|
||||
def test_pricing_is_generic_if_user_is_not_logged_in(
|
||||
client
|
||||
):
|
||||
response = client.get(url_for('main.pricing'))
|
||||
assert response.status_code == 200
|
||||
page = BeautifulSoup(response.data.decode('utf-8'), 'html.parser')
|
||||
last_paragraph = page.select('main p')[-1]
|
||||
assert normalize_spaces(last_paragraph.text) == (
|
||||
'Sign in to download a copy or find out if one is already '
|
||||
'in place with your organisation.'
|
||||
)
|
||||
assert last_paragraph.select_one('a')['href'] == url_for(
|
||||
'main.sign_in',
|
||||
next=url_for('main.pricing', _anchor='paying'),
|
||||
)
|
||||
|
||||
|
||||
@pytest.mark.parametrize((
|
||||
'name,'
|
||||
'agreement_signed,'
|
||||
'expected_terms_paragraph,'
|
||||
'expected_terms_link,'
|
||||
'expected_pricing_paragraph'
|
||||
), [
|
||||
(
|
||||
'Cabinet Office',
|
||||
@@ -194,10 +161,6 @@ def test_pricing_is_generic_if_user_is_not_logged_in(
|
||||
'the GOV.UK Notify data sharing and financial agreement.'
|
||||
),
|
||||
None,
|
||||
(
|
||||
'Download the agreement '
|
||||
'(Cabinet Office has already accepted it).'
|
||||
),
|
||||
),
|
||||
(
|
||||
'Aylesbury Town Council',
|
||||
@@ -211,10 +174,6 @@ def test_pricing_is_generic_if_user_is_not_logged_in(
|
||||
url_for,
|
||||
'main.agreement',
|
||||
),
|
||||
(
|
||||
'Download the agreement '
|
||||
'(Aylesbury Town Council hasn’t accepted it yet).'
|
||||
),
|
||||
),
|
||||
(
|
||||
None,
|
||||
@@ -229,10 +188,6 @@ def test_pricing_is_generic_if_user_is_not_logged_in(
|
||||
url_for,
|
||||
'main.agreement',
|
||||
),
|
||||
(
|
||||
'Download the agreement or contact us to find out if '
|
||||
'we already have one in place with your organisation.'
|
||||
),
|
||||
),
|
||||
(
|
||||
'Met Office',
|
||||
@@ -245,10 +200,6 @@ def test_pricing_is_generic_if_user_is_not_logged_in(
|
||||
url_for,
|
||||
'main.agreement',
|
||||
),
|
||||
(
|
||||
'Download the agreement (Met Office hasn’t accepted it '
|
||||
'yet).'
|
||||
),
|
||||
),
|
||||
])
|
||||
def test_terms_tells_logged_in_users_what_we_know_about_their_agreement(
|
||||
@@ -259,7 +210,6 @@ def test_terms_tells_logged_in_users_what_we_know_about_their_agreement(
|
||||
agreement_signed,
|
||||
expected_terms_paragraph,
|
||||
expected_terms_link,
|
||||
expected_pricing_paragraph,
|
||||
):
|
||||
mock_get_organisation_by_domain(
|
||||
mocker,
|
||||
@@ -267,13 +217,12 @@ def test_terms_tells_logged_in_users_what_we_know_about_their_agreement(
|
||||
agreement_signed=agreement_signed,
|
||||
)
|
||||
terms_page = client_request.get('main.terms')
|
||||
pricing_page = client_request.get('main.pricing')
|
||||
|
||||
assert normalize_spaces(terms_page.select('main p')[1].text) == expected_terms_paragraph
|
||||
if expected_terms_link:
|
||||
assert terms_page.select_one('main p a')['href'] == expected_terms_link()
|
||||
else:
|
||||
assert not terms_page.select_one('main p').select('a')
|
||||
assert normalize_spaces(pricing_page.select('main p')[-1].text) == expected_pricing_paragraph
|
||||
|
||||
|
||||
def test_css_is_served_from_correct_path(client_request):
|
||||
|
||||
Reference in New Issue
Block a user