From e659253b01c232e38372c0f6702e5048ab1e6028 Mon Sep 17 00:00:00 2001 From: Alexey Bezhan Date: Fri, 23 Feb 2018 13:30:35 +0000 Subject: [PATCH] Set Notify service user as the creator of Pre-compiled PDF template --- tests/app/conftest.py | 8 ++++++++ tests/app/db.py | 4 ++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/tests/app/conftest.py b/tests/app/conftest.py index 5da494062..9b7ba156a 100644 --- a/tests/app/conftest.py +++ b/tests/app/conftest.py @@ -102,6 +102,14 @@ def sample_user(notify_db_session): return create_user() +@pytest.fixture(scope='function') +def notify_user(notify_db_session): + return create_user( + email="notify-service-user@digital.cabinet-office.gov.uk", + id_=current_app.config['NOTIFY_USER_ID'] + ) + + def create_code(notify_db, notify_db_session, code_type, usr=None, code=None): if code is None: code = create_secret_code() diff --git a/tests/app/db.py b/tests/app/db.py index bd55e40a3..b67855ecf 100644 --- a/tests/app/db.py +++ b/tests/app/db.py @@ -45,9 +45,9 @@ from app.dao.email_branding_dao import dao_create_email_branding from app.dao.organisation_dao import dao_create_organisation -def create_user(mobile_number="+447700900986", email="notify@digital.cabinet-office.gov.uk", state='active'): +def create_user(mobile_number="+447700900986", email="notify@digital.cabinet-office.gov.uk", state='active', id_=None): data = { - 'id': uuid.uuid4(), + 'id': id_ or uuid.uuid4(), 'name': 'Test User', 'email_address': email, 'password': 'password',