mirror of
https://github.com/GSA/notifications-api.git
synced 2026-08-19 05:58:53 -04:00
Allow jobs to be filtered by contact list
Rather than showing all jobs that have been ‘copied’ from a contact list I think it makes more sense to group them under the contact list. This way it’s easier to see what messages have been sent to a given group of contacts over time. Part of this work means the API needs to return only jobs that have been created from a given contact list, when asked.
This commit is contained in:
@@ -740,6 +740,20 @@ def test_get_jobs_with_limit_days(admin_request, sample_template):
|
||||
assert len(resp_json['data']) == 2
|
||||
|
||||
|
||||
def test_get_jobs_by_contact_list(admin_request, sample_template):
|
||||
contact_list = create_service_contact_list()
|
||||
create_job(template=sample_template)
|
||||
create_job(template=sample_template, contact_list_id=contact_list.id)
|
||||
|
||||
resp_json = admin_request.get(
|
||||
'job.get_jobs_by_service',
|
||||
service_id=sample_template.service_id,
|
||||
contact_list_id=contact_list.id,
|
||||
)
|
||||
|
||||
assert len(resp_json['data']) == 1
|
||||
|
||||
|
||||
def test_get_jobs_should_return_statistics(admin_request, sample_template):
|
||||
now = datetime.utcnow()
|
||||
earlier = datetime.utcnow() - timedelta(days=1)
|
||||
|
||||
Reference in New Issue
Block a user