mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-01 15:46:07 -05:00
Fixed bug where a user with an organisation that wanted the GOVUK only branding ended up with both
If a user was to have an organisation selected in the email settings within the platform admin section, they would be sending emails that contained both the organisation's branding and GOV.UK's. Fix adds a check to ensure that the branding dictionary does not contain organisation details if the the service branding settings is set to 'gov'
This commit is contained in:
@@ -19,6 +19,7 @@ from app.models import (
|
||||
KEY_TYPE_TEST,
|
||||
KEY_TYPE_TEAM,
|
||||
BRANDING_ORG,
|
||||
BRANDING_GOVUK,
|
||||
BRANDING_BOTH)
|
||||
|
||||
from tests.app.db import create_service, create_template, create_notification, create_inbound_number
|
||||
@@ -426,6 +427,18 @@ def test_get_html_email_renderer_with_branding_details(branding_type, govuk_bann
|
||||
assert options['brand_name'] == 'Justice League'
|
||||
|
||||
|
||||
def test_get_html_email_renderer_with_branding_details_and_render_govuk_banner_only(notify_db, sample_service):
|
||||
sample_service.branding = BRANDING_GOVUK
|
||||
org = Organisation(colour='#000000', logo='justice-league.png', name='Justice League')
|
||||
sample_service.organisation = org
|
||||
notify_db.session.add_all([sample_service, org])
|
||||
notify_db.session.commit()
|
||||
|
||||
options = send_to_providers.get_html_email_options(sample_service)
|
||||
|
||||
assert options == {'govuk_banner': True}
|
||||
|
||||
|
||||
def test_get_html_email_renderer_prepends_logo_path(notify_api):
|
||||
Service = namedtuple('Service', ['branding', 'organisation'])
|
||||
Organisation = namedtuple('Organisation', ['colour', 'name', 'logo'])
|
||||
|
||||
Reference in New Issue
Block a user