mirror of
https://github.com/GSA/notifications-api.git
synced 2026-01-31 23:26:23 -05:00
Remove redundant DB fixtures in conftest.py
These were only there to ensure a DB session existed for the test and are now included implicitly as one of the dependencies of the "sample_user" fixture.
This commit is contained in:
@@ -71,7 +71,7 @@ def rmock():
|
||||
|
||||
|
||||
@pytest.fixture(scope='function')
|
||||
def service_factory(notify_db, notify_db_session, sample_user):
|
||||
def service_factory(sample_user):
|
||||
class ServiceFactory(object):
|
||||
def get(self, service_name, user=None, template_type=None, email_from=None):
|
||||
if not user:
|
||||
@@ -133,7 +133,7 @@ def sample_sms_code(notify_db_session):
|
||||
|
||||
|
||||
@pytest.fixture(scope='function')
|
||||
def sample_service(notify_db_session, sample_user):
|
||||
def sample_service(sample_user):
|
||||
service_name = 'Sample service'
|
||||
email_from = service_name.lower().replace(' ', '.')
|
||||
|
||||
@@ -157,7 +157,7 @@ def sample_service(notify_db_session, sample_user):
|
||||
|
||||
|
||||
@pytest.fixture(scope='function')
|
||||
def sample_broadcast_service(notify_db_session, broadcast_organisation, sample_user):
|
||||
def sample_broadcast_service(broadcast_organisation, sample_user):
|
||||
service_name = 'Sample broadcast service'
|
||||
email_from = service_name.lower().replace(' ', '.')
|
||||
|
||||
@@ -201,7 +201,7 @@ def _sample_service_custom_letter_contact_block(sample_service):
|
||||
|
||||
|
||||
@pytest.fixture(scope='function')
|
||||
def sample_template(notify_db_session, sample_user):
|
||||
def sample_template(sample_user):
|
||||
service = create_service(service_permissions=[EMAIL_TYPE, SMS_TYPE], check_if_service_exists=True)
|
||||
|
||||
data = {
|
||||
@@ -239,7 +239,7 @@ def sample_sms_template_with_html(sample_service):
|
||||
|
||||
|
||||
@pytest.fixture(scope='function')
|
||||
def sample_email_template(notify_db_session, sample_user):
|
||||
def sample_email_template(sample_user):
|
||||
service = create_service(user=sample_user, service_permissions=[EMAIL_TYPE, SMS_TYPE], check_if_service_exists=True)
|
||||
data = {
|
||||
'name': 'Email Template Name',
|
||||
@@ -549,7 +549,7 @@ def sample_invited_org_user(sample_user, sample_organisation):
|
||||
|
||||
|
||||
@pytest.fixture(scope='function')
|
||||
def sample_user_service_permission(notify_db_session, sample_user):
|
||||
def sample_user_service_permission(sample_user):
|
||||
service = create_service(user=sample_user, check_if_service_exists=True)
|
||||
permission = 'manage_settings'
|
||||
|
||||
@@ -825,7 +825,7 @@ def letter_volumes_email_template(notify_service):
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def notify_service(notify_db, notify_db_session, sample_user):
|
||||
def notify_service(sample_user):
|
||||
service = Service.query.get(current_app.config['NOTIFY_SERVICE_ID'])
|
||||
if not service:
|
||||
service = Service(
|
||||
|
||||
Reference in New Issue
Block a user