Find email_branding by name

This commit is contained in:
Pea Tyczynska
2018-07-30 13:27:49 +01:00
parent f69bc50985
commit d8d94b431f
3 changed files with 16 additions and 2 deletions

View File

@@ -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()

View File

@@ -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)