mirror of
https://github.com/GSA/notifications-api.git
synced 2025-12-24 01:11:38 -05:00
Fix conflict
This commit is contained in:
@@ -236,10 +236,11 @@ def sample_email_template_with_placeholders(notify_db, notify_db_session):
|
||||
def sample_api_key(notify_db,
|
||||
notify_db_session,
|
||||
service=None,
|
||||
key_type=KEY_TYPE_NORMAL):
|
||||
key_type=KEY_TYPE_NORMAL,
|
||||
name=None):
|
||||
if service is None:
|
||||
service = sample_service(notify_db, notify_db_session)
|
||||
data = {'service': service, 'name': uuid.uuid4(), 'created_by': service.created_by, 'key_type': key_type}
|
||||
data = {'service': service, 'name': name or uuid.uuid4(), 'created_by': service.created_by, 'key_type': key_type}
|
||||
api_key = ApiKey(**data)
|
||||
save_model_api_key(api_key)
|
||||
return api_key
|
||||
@@ -261,7 +262,7 @@ def sample_job(notify_db,
|
||||
service=None,
|
||||
template=None,
|
||||
notification_count=1,
|
||||
created_at=datetime.utcnow(),
|
||||
created_at=None,
|
||||
job_status='pending',
|
||||
scheduled_for=None):
|
||||
if service is None:
|
||||
@@ -277,7 +278,7 @@ def sample_job(notify_db,
|
||||
'template_version': template.version,
|
||||
'original_file_name': 'some.csv',
|
||||
'notification_count': notification_count,
|
||||
'created_at': created_at,
|
||||
'created_at': created_at or datetime.utcnow(),
|
||||
'created_by': service.created_by,
|
||||
'job_status': job_status,
|
||||
'scheduled_for': scheduled_for
|
||||
@@ -445,6 +446,17 @@ def sample_notification(notify_db,
|
||||
return notification
|
||||
|
||||
|
||||
@pytest.fixture(scope='function')
|
||||
def sample_notification_with_api_key(notify_db, notify_db_session):
|
||||
notification = sample_notification(notify_db, notify_db_session)
|
||||
notification.api_key_id = sample_api_key(
|
||||
notify_db,
|
||||
notify_db_session,
|
||||
name='Test key'
|
||||
).id
|
||||
return notification
|
||||
|
||||
|
||||
@pytest.fixture(scope='function')
|
||||
def sample_email_notification(notify_db, notify_db_session):
|
||||
created_at = datetime.utcnow()
|
||||
|
||||
Reference in New Issue
Block a user