mirror of
https://github.com/GSA/notifications-api.git
synced 2025-12-23 17:01:35 -05:00
Make a couple of fixtures Pytest 4 compliant
By stopping them from calling other fixtures as functions.
This commit is contained in:
@@ -272,17 +272,15 @@ def sample_template_without_letter_permission(notify_db, notify_db_session):
|
||||
|
||||
|
||||
@pytest.fixture(scope='function')
|
||||
def sample_template_with_placeholders(notify_db, notify_db_session):
|
||||
def sample_template_with_placeholders(sample_service):
|
||||
# deliberate space and title case in placeholder
|
||||
return sample_template(notify_db, notify_db_session, content="Hello (( Name))\nYour thing is due soon")
|
||||
return create_template(sample_service, content="Hello (( Name))\nYour thing is due soon")
|
||||
|
||||
|
||||
@pytest.fixture(scope='function')
|
||||
def sample_sms_template_with_html(notify_db, notify_db_session):
|
||||
def sample_sms_template_with_html(sample_service):
|
||||
# deliberate space and title case in placeholder
|
||||
return sample_template(notify_db, notify_db_session, content=(
|
||||
"Hello (( Name))\nHere is <em>some HTML</em> & entities"
|
||||
))
|
||||
return create_template(sample_service, content="Hello (( Name))\nHere is <em>some HTML</em> & entities")
|
||||
|
||||
|
||||
@pytest.fixture(scope='function')
|
||||
@@ -411,31 +409,20 @@ def sample_job(
|
||||
|
||||
@pytest.fixture(scope='function')
|
||||
def sample_job_with_placeholdered_template(
|
||||
notify_db,
|
||||
notify_db_session,
|
||||
service=None
|
||||
sample_job,
|
||||
sample_template_with_placeholders,
|
||||
):
|
||||
return sample_job(
|
||||
notify_db,
|
||||
notify_db_session,
|
||||
service=service,
|
||||
template=sample_template_with_placeholders(notify_db, notify_db_session)
|
||||
)
|
||||
sample_job.template = sample_template_with_placeholders
|
||||
|
||||
return sample_job
|
||||
|
||||
|
||||
@pytest.fixture(scope='function')
|
||||
def sample_scheduled_job(
|
||||
notify_db,
|
||||
notify_db_session,
|
||||
service=None
|
||||
):
|
||||
return sample_job(
|
||||
notify_db,
|
||||
notify_db_session,
|
||||
service=service,
|
||||
template=sample_template_with_placeholders(notify_db, notify_db_session),
|
||||
scheduled_for=(datetime.utcnow() + timedelta(minutes=60)).isoformat(),
|
||||
job_status='scheduled'
|
||||
def sample_scheduled_job(sample_template_with_placeholders):
|
||||
return create_job(
|
||||
sample_template_with_placeholders,
|
||||
job_status='scheduled',
|
||||
scheduled_for=(datetime.utcnow() + timedelta(minutes=60)).isoformat()
|
||||
)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user