From 87d7ed21a22828342cb959d8d4e101a653dcbeb2 Mon Sep 17 00:00:00 2001 From: Katie Smith Date: Thu, 31 Oct 2019 09:42:07 +0000 Subject: [PATCH] Fix fixtures Stopped 2 fixtures from calling other fixtures as functions and causing errors. --- tests/app/conftest.py | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/tests/app/conftest.py b/tests/app/conftest.py index 4a9ce471b..35c270ce9 100644 --- a/tests/app/conftest.py +++ b/tests/app/conftest.py @@ -325,21 +325,23 @@ def sample_trial_letter_template(sample_service_full_permissions): @pytest.fixture(scope='function') -def sample_email_template_with_placeholders(notify_db, notify_db_session): - return sample_email_template( - notify_db, - notify_db_session, +def sample_email_template_with_placeholders(sample_service): + return create_template( + sample_service, + template_type=EMAIL_TYPE, + subject="((name))", content="Hello ((name))\nThis is an email from GOV.UK", - subject_line="((name))") + ) @pytest.fixture(scope='function') -def sample_email_template_with_html(notify_db, notify_db_session): - return sample_email_template( - notify_db, - notify_db_session, +def sample_email_template_with_html(sample_service): + return create_template( + sample_service, + template_type=EMAIL_TYPE, + subject="((name)) some HTML", content="Hello ((name))\nThis is an email from GOV.UK with some HTML", - subject_line="((name)) some HTML") + ) @pytest.fixture(scope='function') @@ -499,7 +501,7 @@ def sample_notification_with_job( key_type=KEY_TYPE_NORMAL ): if not service: - service = create_service() + service = create_service(check_if_service_exists=True) if not template: template = create_template(service=service) if job is None: