Refactor creating nhs branding in tests into a fixture

This commit is contained in:
Pea Tyczynska
2022-04-19 12:25:11 +01:00
parent 769b71cdc0
commit 124562b50a
2 changed files with 19 additions and 30 deletions

View File

@@ -53,6 +53,7 @@ from app.models import (
from tests import create_admin_authorization_header
from tests.app.db import (
create_api_key,
create_email_branding,
create_inbound_number,
create_invited_org_user,
create_job,
@@ -919,6 +920,19 @@ def broadcast_organisation(notify_db_session):
return org
@pytest.fixture
def nhs_email_branding(notify_db_session):
# we wipe email_branding table in test db between the tests, so we have to recreate this branding
# that is normally present on all environments and applied through migration
nhs_email_branding_id = current_app.config['NHS_EMAIL_BRANDING_ID']
return create_email_branding(
id=nhs_email_branding_id,
logo='1ac6f483-3105-4c9e-9017-dd7fb2752c44-nhs-blue_x2.png',
name='NHS'
)
@pytest.fixture
def restore_provider_details(notify_db, notify_db_session):
"""