diff --git a/app/main/views/agreement.py b/app/main/views/agreement.py
index cb58c236f..e4ab40cd1 100644
--- a/app/main/views/agreement.py
+++ b/app/main/views/agreement.py
@@ -13,7 +13,12 @@ def agreement():
agreement_info = AgreementInfo.from_current_user()
- agreement_info.crown_status_or_404
+ if agreement_info.crown_status is None:
+ return render_template(
+ 'views/agreement-choose.html',
+ owner=agreement_info.owner,
+ navigation_links=features_nav(),
+ )
return render_template(
'views/agreement.html',
diff --git a/app/templates/views/agreement-choose.html b/app/templates/views/agreement-choose.html
new file mode 100644
index 000000000..6be24d1a1
--- /dev/null
+++ b/app/templates/views/agreement-choose.html
@@ -0,0 +1,59 @@
+{% extends "withoutnav_template.html" %}
+{% from "components/sub-navigation.html" import sub_navigation %}
+
+{% block per_page_title %}
+ Download the GOV.UK Notify data sharing and financial agreement
+{% endblock %}
+
+{% block maincolumn_content %}
+
+
+
+ {{ sub_navigation(navigation_links) }}
+
+
+
+
+ Download the GOV.UK Notify data sharing and financial agreement
+
+
+
+ Before you can go live on GOV.UK Notify, your organisation needs to agree to our data sharing and financial agreement.
+
+
+ Crown bodies
+
+
+ Download the crown agreement.
+
+
+ Non-crown bodies
+
+
+ Download the non-crown agreement.
+
+
+
+ Unsure whether your organisation is a crown body? Contact
+ support
+ and we’ll help you work it out.
+
+
+
+ Next steps
+
+
+ -
+ Get the agreement signed by someone who has the authority to do so on behalf of {{ owner or 'your organisation' }}.
+
+ -
+ Return the signed copy to notify-support@digital.cabinet-office.gov.uk.
+
+
+
+ The agreement contains commercially sensitive information, so don’t share it more widely than you need to.
+
+
+
+
+{% endblock %}
diff --git a/tests/app/main/views/test_agreement.py b/tests/app/main/views/test_agreement.py
index c29d394ca..396efb699 100644
--- a/tests/app/main/views/test_agreement.py
+++ b/tests/app/main/views/test_agreement.py
@@ -1,3 +1,4 @@
+from functools import partial
from io import BytesIO
import pytest
@@ -15,25 +16,46 @@ class _MockS3Object():
return {'Body': BytesIO(self.data)}
-@pytest.mark.parametrize('email_address, expected_status', [
- ('test@cabinet-office.gov.uk', 200),
- ('test@aylesburytowncouncil.gov.uk', 200),
- ('test@unknown.gov.uk', 404),
+@pytest.mark.parametrize('email_address, expected_links', [
+ (
+ 'test@cabinet-office.gov.uk',
+ [
+ partial(url_for, 'main.download_agreement'),
+ lambda: 'mailto:notify-support@digital.cabinet-office.gov.uk',
+ ]
+ ),
+ (
+ 'test@aylesburytowncouncil.gov.uk',
+ [
+ partial(url_for, 'main.download_agreement'),
+ lambda: 'mailto:notify-support@digital.cabinet-office.gov.uk',
+ ]
+ ),
+ (
+ 'test@unknown.gov.uk',
+ [
+ partial(url_for, 'main.public_download_agreement', variant='crown'),
+ partial(url_for, 'main.public_download_agreement', variant='non-crown'),
+ partial(url_for, 'main.support'),
+ lambda: 'mailto:notify-support@digital.cabinet-office.gov.uk',
+ ]
+ ),
])
def test_show_agreement_page(
client_request,
mocker,
fake_uuid,
email_address,
- expected_status,
+ expected_links,
):
user = active_user_with_permissions(fake_uuid)
user.email_address = email_address
mocker.patch('app.user_api_client.get_user', return_value=user)
- client_request.get(
- 'main.agreement',
- _expected_status=expected_status,
- )
+ page = client_request.get('main.agreement')
+ links = page.select('main .column-two-thirds a')
+ assert len(links) == len(expected_links)
+ for index, link in enumerate(links):
+ assert link['href'] == expected_links[index]()
@pytest.mark.parametrize('email_address, expected_file_fetched, expected_file_served', [