mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-18 21:49:37 -04:00
Use NHS.UK branding is for all NHS services
Anyone choosing ‘NHS’ for their organisation type gets should get the NHS branding. We don’t want to hard-code an ID for NHS branding anywhere because it won’t be consistent between environments. So instead we can say that anyone who chooses ‘NHS’ as their organisation type should get whatever branding has `nhs.uk` as its domain. This allows us to easily manage the branding the same way we do other brands, but gives us the efficiency of having it auto applied.
This commit is contained in:
@@ -82,6 +82,7 @@ def test_should_add_service_and_redirect_to_dashboard_when_existing_service(
|
||||
mock_create_service,
|
||||
mock_create_service_template,
|
||||
mock_get_services,
|
||||
mock_update_service,
|
||||
api_user_active,
|
||||
organisation_type,
|
||||
free_allowance,
|
||||
@@ -111,10 +112,15 @@ def test_should_add_service_and_redirect_to_dashboard_when_existing_service(
|
||||
assert response.location == url_for('main.service_dashboard', service_id=101, _external=True)
|
||||
|
||||
|
||||
@pytest.mark.parametrize('email_address, expected_branding', [
|
||||
('test@example.voa.gsi.gov.uk', '5'),
|
||||
('test@example.voa.gov.uk', '5'),
|
||||
('test@example.gov.uk', None),
|
||||
@pytest.mark.parametrize('organisation_type, email_address, expected_branding', [
|
||||
('central', 'test@example.voa.gsi.gov.uk', '5'),
|
||||
('central', 'test@example.voa.gov.uk', '5'),
|
||||
('central', 'test@example.gov.uk', None),
|
||||
# Anyone choosing ‘NHS’ for organisation type gets NHS branding no
|
||||
# matter what their email domain is (but we look it up based on the
|
||||
# `nhs.uk` domain to avoid hard-coding a branding ID anywhere)
|
||||
('nhs', 'test@example.voa.gov.uk', '4'),
|
||||
('nhs', 'test@nhs.uk', '4'),
|
||||
])
|
||||
def test_should_lookup_branding_for_known_domain(
|
||||
app_,
|
||||
@@ -125,6 +131,7 @@ def test_should_lookup_branding_for_known_domain(
|
||||
mock_update_service,
|
||||
mock_create_or_update_free_sms_fragment_limit,
|
||||
mock_get_all_email_branding,
|
||||
organisation_type,
|
||||
email_address,
|
||||
expected_branding,
|
||||
):
|
||||
@@ -134,7 +141,7 @@ def test_should_lookup_branding_for_known_domain(
|
||||
'main.add_service',
|
||||
_data={
|
||||
'name': 'testing the post',
|
||||
'organisation_type': 'central',
|
||||
'organisation_type': organisation_type,
|
||||
}
|
||||
)
|
||||
mock_get_all_email_branding.assert_called_once_with()
|
||||
|
||||
Reference in New Issue
Block a user