Fix fixtures

Stopped 2 fixtures from calling other fixtures as functions and causing
errors.
This commit is contained in:
Katie Smith
2019-10-31 09:42:07 +00:00
parent c35aca25e0
commit 87d7ed21a2

View File

@@ -325,21 +325,23 @@ def sample_trial_letter_template(sample_service_full_permissions):
@pytest.fixture(scope='function') @pytest.fixture(scope='function')
def sample_email_template_with_placeholders(notify_db, notify_db_session): def sample_email_template_with_placeholders(sample_service):
return sample_email_template( return create_template(
notify_db, sample_service,
notify_db_session, template_type=EMAIL_TYPE,
subject="((name))",
content="Hello ((name))\nThis is an email from GOV.UK", content="Hello ((name))\nThis is an email from GOV.UK",
subject_line="((name))") )
@pytest.fixture(scope='function') @pytest.fixture(scope='function')
def sample_email_template_with_html(notify_db, notify_db_session): def sample_email_template_with_html(sample_service):
return sample_email_template( return create_template(
notify_db, sample_service,
notify_db_session, template_type=EMAIL_TYPE,
subject="((name)) <em>some HTML</em>",
content="Hello ((name))\nThis is an email from GOV.UK with <em>some HTML</em>", content="Hello ((name))\nThis is an email from GOV.UK with <em>some HTML</em>",
subject_line="((name)) <em>some HTML</em>") )
@pytest.fixture(scope='function') @pytest.fixture(scope='function')
@@ -499,7 +501,7 @@ def sample_notification_with_job(
key_type=KEY_TYPE_NORMAL key_type=KEY_TYPE_NORMAL
): ):
if not service: if not service:
service = create_service() service = create_service(check_if_service_exists=True)
if not template: if not template:
template = create_template(service=service) template = create_template(service=service)
if job is None: if job is None: