mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-01 23:55:58 -05:00
Stop fixtures in conftest from calling other fixtures
Stopped some the fixtures in conftest.py from calling other fixtures as functions to make them Pytest 4 compliant.
This commit is contained in:
@@ -357,13 +357,23 @@ def sample_api_key(notify_db,
|
|||||||
|
|
||||||
|
|
||||||
@pytest.fixture(scope='function')
|
@pytest.fixture(scope='function')
|
||||||
def sample_test_api_key(notify_db, notify_db_session, service=None):
|
def sample_test_api_key(sample_api_key):
|
||||||
return sample_api_key(notify_db, notify_db_session, service, KEY_TYPE_TEST)
|
service = create_service(check_if_service_exists=True)
|
||||||
|
|
||||||
|
return create_api_key(
|
||||||
|
service,
|
||||||
|
key_type=KEY_TYPE_TEST
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture(scope='function')
|
@pytest.fixture(scope='function')
|
||||||
def sample_team_api_key(notify_db, notify_db_session, service=None):
|
def sample_team_api_key(sample_api_key):
|
||||||
return sample_api_key(notify_db, notify_db_session, service, KEY_TYPE_TEAM)
|
service = create_service(check_if_service_exists=True)
|
||||||
|
|
||||||
|
return create_api_key(
|
||||||
|
service,
|
||||||
|
key_type=KEY_TYPE_TEAM
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture(scope='function')
|
@pytest.fixture(scope='function')
|
||||||
@@ -613,11 +623,11 @@ def sample_letter_notification(sample_letter_template):
|
|||||||
|
|
||||||
|
|
||||||
@pytest.fixture(scope='function')
|
@pytest.fixture(scope='function')
|
||||||
def sample_email_notification(notify_db, notify_db_session):
|
def sample_email_notification(notify_db_session):
|
||||||
created_at = datetime.utcnow()
|
created_at = datetime.utcnow()
|
||||||
service = create_service(check_if_service_exists=True)
|
service = create_service(check_if_service_exists=True)
|
||||||
template = sample_email_template(notify_db, notify_db_session, service=service)
|
template = create_template(service, template_type=EMAIL_TYPE)
|
||||||
job = sample_job(notify_db, notify_db_session, service=service, template=template)
|
job = create_job(template)
|
||||||
|
|
||||||
notification_id = uuid.uuid4()
|
notification_id = uuid.uuid4()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user