Fix the fixtures for templates lacking certain permissions

These fixtures were both calling other fixtures as functions and being
called as functions in the tests. Rewriting the tests to make them
Pytest 4 compatible means we are no longer using
`sample_template_without_letter_permission`, so this has been deleted.
This commit is contained in:
Katie Smith
2019-10-28 16:31:47 +00:00
parent 6252dcf916
commit 99c3837dc1
3 changed files with 59 additions and 37 deletions

View File

@@ -262,13 +262,9 @@ def sample_template(
@pytest.fixture(scope='function')
def sample_template_without_sms_permission(notify_db, notify_db_session):
return sample_template(notify_db, notify_db_session, permissions=[EMAIL_TYPE])
@pytest.fixture(scope='function')
def sample_template_without_letter_permission(notify_db, notify_db_session):
return sample_template(notify_db, notify_db_session, template_type="letter", permissions=[EMAIL_TYPE])
def sample_template_without_sms_permission(notify_db_session):
service = create_service(service_permissions=[EMAIL_TYPE], check_if_service_exists=True)
return create_template(service, template_type=SMS_TYPE)
@pytest.fixture(scope='function')
@@ -312,8 +308,9 @@ def sample_email_template(
@pytest.fixture(scope='function')
def sample_template_without_email_permission(notify_db, notify_db_session):
return sample_email_template(notify_db, notify_db_session, permissions=[SMS_TYPE])
def sample_template_without_email_permission(notify_db_session):
service = create_service(service_permissions=[SMS_TYPE], check_if_service_exists=True)
return create_template(service, template_type=EMAIL_TYPE)
@pytest.fixture