mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-01 07:35:34 -05:00
Find email_branding by name
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
from app.dao.email_branding_dao import (
|
||||
dao_get_email_branding_options,
|
||||
dao_get_email_branding_by_id,
|
||||
dao_get_email_branding_by_name,
|
||||
dao_update_email_branding,
|
||||
)
|
||||
from app.models import EmailBranding
|
||||
@@ -27,6 +28,14 @@ def test_get_email_branding_by_id_gets_correct_email_branding(notify_db, notify_
|
||||
assert email_branding_from_db == email_branding
|
||||
|
||||
|
||||
def test_get_email_branding_by_name_gets_correct_email_branding(notify_db, notify_db_session):
|
||||
email_branding = create_email_branding(name="Crystal Gems")
|
||||
|
||||
email_branding_from_db = dao_get_email_branding_by_name("Crystal Gems")
|
||||
|
||||
assert email_branding_from_db == email_branding
|
||||
|
||||
|
||||
def test_update_email_branding(notify_db, notify_db_session):
|
||||
updated_name = 'new name'
|
||||
create_email_branding()
|
||||
|
||||
@@ -329,11 +329,12 @@ def create_service_callback_api(
|
||||
return service_callback_api
|
||||
|
||||
|
||||
def create_email_branding(colour='blue', logo='test_x2.png', name='test_org_1'):
|
||||
def create_email_branding(colour='blue', logo='test_x2.png', name='test_org_1', text='DisplayName'):
|
||||
data = {
|
||||
'colour': colour,
|
||||
'logo': logo,
|
||||
'name': name
|
||||
'name': name,
|
||||
'text': text,
|
||||
}
|
||||
email_branding = EmailBranding(**data)
|
||||
dao_create_email_branding(email_branding)
|
||||
|
||||
Reference in New Issue
Block a user