Skip to content

Commit

Permalink
[#299] Fix fixtures
Browse files Browse the repository at this point in the history
Stopped 2 fixtures from calling other fixtures as functions and causing
errors.
  • Loading branch information
klssmith authored and philherbert committed Dec 31, 2020
1 parent 57bc6cc commit edeaef5
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions tests/app/conftest.py
Expand Up @@ -501,21 +501,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)) <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')
Expand Down Expand Up @@ -665,7 +667,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:
Expand Down

0 comments on commit edeaef5

Please sign in to comment.