From d919b4c20e0d4a50a3d312717dcf7569e430680a Mon Sep 17 00:00:00 2001 From: Jumana Bahrainwala Date: Wed, 6 Mar 2024 20:00:04 +0000 Subject: [PATCH] fixes --- app/dao/organisation_dao.py | 9 ++++++++- tests/app/email_branding/test_rest.py | 6 ++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/app/dao/organisation_dao.py b/app/dao/organisation_dao.py index 1845e0888e..06ed25958d 100644 --- a/app/dao/organisation_dao.py +++ b/app/dao/organisation_dao.py @@ -2,7 +2,14 @@ from app import db from app.dao.dao_utils import transactional, version_class -from app.models import Domain, EmailBranding, InvitedOrganisationUser, Organisation, Service, User +from app.models import ( + Domain, + EmailBranding, + InvitedOrganisationUser, + Organisation, + Service, + User, +) def dao_get_organisations(): diff --git a/tests/app/email_branding/test_rest.py b/tests/app/email_branding/test_rest.py index edd0de0a68..9d7bd1f6f7 100644 --- a/tests/app/email_branding/test_rest.py +++ b/tests/app/email_branding/test_rest.py @@ -4,8 +4,8 @@ from tests.app.db import create_email_branding -def test_get_email_branding_options(admin_request, notify_db, notify_db_session): - email_branding1 = EmailBranding(colour="#FFFFFF", logo="/path/image.png", name="Org1") +def test_get_email_branding_options(admin_request, notify_db, notify_db_session, sample_organisation): + email_branding1 = EmailBranding(colour="#FFFFFF", logo="/path/image.png", name="Org1", organisation_id=sample_organisation.id) email_branding2 = EmailBranding(colour="#000000", logo="/path/other.png", name="Org2") notify_db.session.add_all([email_branding1, email_branding2]) notify_db.session.commit() @@ -17,6 +17,8 @@ def test_get_email_branding_options(admin_request, notify_db, notify_db_session) str(email_branding1.id), str(email_branding2.id), } + assert email_branding[0]["organisation_id"] == str(sample_organisation.id) + assert email_branding[1]["organisation_id"] == "" def test_get_email_branding_by_id(admin_request, notify_db, notify_db_session):