From 4312789b60cdf0fd6d34fcc048bca12da3613959 Mon Sep 17 00:00:00 2001 From: chrisw Date: Tue, 19 Sep 2017 13:32:42 +0100 Subject: [PATCH] Add a non-GOV.UK banner option for email branding Added extra radio button for 'org_banner' option Updated service setting template to display appropriate text when option is selected Updated tests to also accomodate new radio option --- app/main/forms.py | 3 ++- app/templates/views/service-settings.html | 2 ++ tests/app/main/views/test_service_settings.py | 4 ++++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/app/main/forms.py b/app/main/forms.py index 1bdbb2ba6..74356b0a5 100644 --- a/app/main/forms.py +++ b/app/main/forms.py @@ -511,7 +511,8 @@ class ServiceBrandingOrg(Form): choices=[ ('govuk', 'GOV.UK only'), ('both', 'GOV.UK and organisation'), - ('org', 'Organisation only') + ('org', 'Organisation only'), + ('org_banner', 'Organisation banner') ], validators=[ DataRequired() diff --git a/app/templates/views/service-settings.html b/app/templates/views/service-settings.html index b945e24ce..873a590fb 100644 --- a/app/templates/views/service-settings.html +++ b/app/templates/views/service-settings.html @@ -187,6 +187,8 @@ GOV.UK and {{ organisation.name if organisation else None }} {% elif current_service.branding == 'org' %} Only {{ organisation.name if organisation else None }} + {% elif current_service.branding == 'org_banner' %} + Only {{ organisation.name if organisation else None }} banner {% endif %} {% endcall %} {{ edit_field('Change', url_for('.service_set_branding_and_org', service_id=current_service.id)) }} diff --git a/tests/app/main/views/test_service_settings.py b/tests/app/main/views/test_service_settings.py index ec1e8156e..a11bcd0ec 100644 --- a/tests/app/main/views/test_service_settings.py +++ b/tests/app/main/views/test_service_settings.py @@ -922,10 +922,12 @@ def test_should_show_branding( assert page.find('input', attrs={"id": "branding_type-0"})['value'] == 'govuk' assert page.find('input', attrs={"id": "branding_type-1"})['value'] == 'both' assert page.find('input', attrs={"id": "branding_type-2"})['value'] == 'org' + assert page.find('input', attrs={"id": "branding_type-3"})['value'] == 'org_banner' assert 'checked' in page.find('input', attrs={"id": "branding_type-0"}).attrs assert 'checked' not in page.find('input', attrs={"id": "branding_type-1"}).attrs assert 'checked' not in page.find('input', attrs={"id": "branding_type-2"}).attrs + assert 'checked' not in page.find('input', attrs={"id": "branding_type-3"}).attrs app.organisations_client.get_organisations.assert_called_once_with() app.service_api_client.get_service.assert_called_once_with(service_one['id']) @@ -945,10 +947,12 @@ def test_should_show_organisations( assert page.find('input', attrs={"id": "branding_type-0"})['value'] == 'govuk' assert page.find('input', attrs={"id": "branding_type-1"})['value'] == 'both' assert page.find('input', attrs={"id": "branding_type-2"})['value'] == 'org' + assert page.find('input', attrs={"id": "branding_type-3"})['value'] == 'org_banner' assert 'checked' in page.find('input', attrs={"id": "branding_type-0"}).attrs assert 'checked' not in page.find('input', attrs={"id": "branding_type-1"}).attrs assert 'checked' not in page.find('input', attrs={"id": "branding_type-2"}).attrs + assert 'checked' not in page.find('input', attrs={"id": "branding_type-3"}).attrs app.organisations_client.get_organisations.assert_called_once_with() app.service_api_client.get_service.assert_called_once_with(service_one['id'])