Remove the user-specific agreement pages

We used to give users the right version of the agreement by guessing
their organisation from their email address.

Now we do it by looking at the organisation of the service they’re
looking at.

In other words, users should only be downloading the agreement as part
of the go live journey, not outside it. This is because we think that
users will get confused if they download the agreement and:
- find there’s nowhere to physically sign it
- think that accepting the agreement is all they need to do to go live

Maintaining two paths to download the agreement also makes the code more
complicated, and makes it harder to update the content on these pages.
This commit is contained in:
Chris Hill-Scott
2019-07-12 09:03:35 +01:00
parent 3167c6dc31
commit a256b9c33a
9 changed files with 64 additions and 318 deletions

View File

@@ -1,15 +1,9 @@
from functools import partial
import pytest
from bs4 import BeautifulSoup
from flask import url_for
from app.main.forms import FieldWithNoneOption
from tests.conftest import (
mock_get_organisation_by_domain,
normalize_spaces,
sample_uuid,
)
from tests.conftest import normalize_spaces, sample_uuid
def test_non_logged_in_user_can_see_homepage(
@@ -144,96 +138,12 @@ def test_old_integration_testing_page(
)
def test_terms_is_generic_if_user_is_not_logged_in(
client
):
response = client.get(url_for('main.terms'))
assert response.status_code == 200
page = BeautifulSoup(response.data.decode('utf-8'), 'html.parser')
assert normalize_spaces(page.select('main p')[1].text) == (
'Your organisation must also accept our data sharing and '
'financial agreement. Sign in to download a copy or find out '
'if one is already in place.'
)
@pytest.mark.parametrize((
'name,'
'agreement_signed,'
'expected_terms_paragraph,'
'expected_terms_link,'
), [
(
'Cabinet Office',
True,
(
'Your organisation (Cabinet Office) has already accepted '
'the GOV.UK Notify data sharing and financial agreement.'
),
None,
),
(
'Aylesbury Town Council',
False,
(
'Your organisation (Aylesbury Town Council) must also '
'accept our data sharing and financial agreement. Download '
'a copy.'
),
partial(
url_for,
'main.agreement',
),
),
(
None,
None,
(
'Your organisation must also accept our data sharing and '
'financial agreement. Download the agreement or contact us '
'to find out if we already have one in place with your '
'organisation.'
),
partial(
url_for,
'main.agreement',
),
),
(
'Met Office',
False,
(
'Your organisation (Met Office) must also accept our data '
'sharing and financial agreement. Download a copy.'
),
partial(
url_for,
'main.agreement',
),
),
])
def test_terms_tells_logged_in_users_what_we_know_about_their_agreement(
mocker,
fake_uuid,
client_request,
name,
agreement_signed,
expected_terms_paragraph,
expected_terms_link,
):
mock_get_organisation_by_domain(
mocker,
name=name,
agreement_signed=agreement_signed,
)
def test_terms_page_has_correct_content(client_request):
terms_page = client_request.get('main.terms')
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(terms_page.select('main p')[0].text) == (
'These terms apply to your services use of GOV.UK Notify. '
'You must be the service manager to accept them.'
)
def test_css_is_served_from_correct_path(client_request):