mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-24 16:24:08 -04:00
Merge pull request #3251 from alphagov/job-model
Make models for individual jobs and collections of jobs
This commit is contained in:
@@ -1732,12 +1732,16 @@ def mock_get_uploads(mocker, api_user_active):
|
||||
'notification_count': 10,
|
||||
'created_at': '2016-01-01 11:09:00.061258',
|
||||
'statistics': [{'count': 8, 'status': 'delivered'}, {'count': 2, 'status': 'temporary-failure'}],
|
||||
'scheduled_for': None,
|
||||
'job_status': 'finished',
|
||||
'upload_type': 'job'},
|
||||
{'id': 'job_id_1',
|
||||
'original_file_name': 'some.csv',
|
||||
'notification_count': 1,
|
||||
'created_at': '2016-01-01 11:09:00.061258',
|
||||
'statistics': [{'count': 1, 'status': 'delivered'}],
|
||||
'scheduled_for': None,
|
||||
'job_status': 'finished',
|
||||
'upload_type': 'letter'}
|
||||
]
|
||||
return {
|
||||
@@ -1747,8 +1751,8 @@ def mock_get_uploads(mocker, api_user_active):
|
||||
'next': 'services/{}/uploads?page={}'.format(service_id, page + 1)
|
||||
}
|
||||
}
|
||||
|
||||
return mocker.patch('app.job_api_client.get_uploads', side_effect=_get_uploads)
|
||||
# Why is mocking on the model needed?
|
||||
return mocker.patch('app.models.job.PaginatedUploads.client', side_effect=_get_uploads)
|
||||
|
||||
|
||||
@pytest.fixture(scope='function')
|
||||
|
||||
Reference in New Issue
Block a user