mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-02 17:31:14 -05:00
Now that EmailBranding includes the brand type we do not need two separate colours. This PR removes the new colour columns.
This commit is contained in:
@@ -13,7 +13,6 @@ from app import mmg_client, firetext_client
|
||||
from app.dao import (provider_details_dao, notifications_dao)
|
||||
from app.dao.provider_details_dao import dao_switch_sms_provider_to_provider_with_identifier
|
||||
from app.delivery import send_to_providers
|
||||
from app.delivery.send_to_providers import _set_colour
|
||||
from app.exceptions import NotificationTechnicalFailureException
|
||||
from app.models import (
|
||||
Notification,
|
||||
@@ -456,13 +455,11 @@ def test_get_html_email_renderer_with_branding_details_and_render_govuk_banner_o
|
||||
|
||||
def test_get_html_email_renderer_prepends_logo_path(notify_api):
|
||||
Service = namedtuple('Service', ['branding', 'email_branding'])
|
||||
EmailBranding = namedtuple('EmailBranding', ['colour', 'name', 'logo', 'text', 'banner_colour', 'single_id_colour'])
|
||||
EmailBranding = namedtuple('EmailBranding', ['colour', 'name', 'logo', 'text'])
|
||||
|
||||
email_branding = EmailBranding(colour='#000000', logo='justice-league.png',
|
||||
name='Justice League',
|
||||
text='League of Justice',
|
||||
banner_colour='#ABEBC6',
|
||||
single_id_colour='#DB6849')
|
||||
text='League of Justice')
|
||||
service = Service(branding=BRANDING_ORG, email_branding=email_branding)
|
||||
|
||||
renderer = send_to_providers.get_html_email_options(service)
|
||||
@@ -472,11 +469,9 @@ def test_get_html_email_renderer_prepends_logo_path(notify_api):
|
||||
|
||||
def test_get_html_email_renderer_handles_email_branding_without_logo(notify_api):
|
||||
Service = namedtuple('Service', ['branding', 'email_branding'])
|
||||
EmailBranding = namedtuple('EmailBranding', ['colour', 'name', 'logo', 'text', 'banner_colour', 'single_id_colour'])
|
||||
EmailBranding = namedtuple('EmailBranding', ['colour', 'name', 'logo', 'text'])
|
||||
|
||||
email_branding = EmailBranding(colour='#000000', logo=None, name='Justice League', text='League of Justice',
|
||||
banner_colour='#ABEBC6',
|
||||
single_id_colour='#DB6849')
|
||||
email_branding = EmailBranding(colour='#000000', logo=None, name='Justice League', text='League of Justice')
|
||||
service = Service(branding=BRANDING_ORG_BANNER, email_branding=email_branding)
|
||||
|
||||
renderer = send_to_providers.get_html_email_options(service)
|
||||
@@ -752,26 +747,3 @@ def test_send_email_to_provider_should_format_email_address(sample_email_notific
|
||||
html_body=ANY,
|
||||
reply_to_address=ANY,
|
||||
)
|
||||
|
||||
|
||||
@pytest.mark.parametrize('colour, banner_colour, single_id_colour, branding_type, expected_colour', [
|
||||
('black', 'yellow', 'red', 'org', 'red'),
|
||||
('black', 'yellow', None, 'org', 'black'),
|
||||
('black', 'yellow', 'red', 'org_banner', 'yellow'),
|
||||
('black', None, 'red', 'org_banner', 'black'),
|
||||
('black', 'yellow', 'red', 'govuk', None),
|
||||
('black', 'yellow', 'red', 'both', 'red'),
|
||||
('black', 'yellow', None, 'both', 'black'),
|
||||
])
|
||||
def test_set_colour(notify_db_session, colour, banner_colour, single_id_colour, branding_type, expected_colour):
|
||||
Service = namedtuple('Service', ['branding', 'email_branding'])
|
||||
email_branding = EmailBranding(colour=colour,
|
||||
logo='justice-league.png',
|
||||
name='Justice League',
|
||||
text='League of Justice',
|
||||
banner_colour=banner_colour,
|
||||
single_id_colour=single_id_colour)
|
||||
service = Service(branding=branding_type, email_branding=email_branding)
|
||||
|
||||
colour = _set_colour(service)
|
||||
assert colour == expected_colour
|
||||
|
||||
Reference in New Issue
Block a user