mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-03 18:01:08 -05:00
Don’t return jobs sent from contact lists
Now that we’re grouping jobs sent from contact lists within their parent, they shouldn’t also be listed on the jobs page at the top level.
This commit is contained in:
@@ -172,7 +172,6 @@ def test_get_jobs_for_service_by_contact_list(sample_template):
|
||||
assert dao_get_jobs_by_service_id(
|
||||
sample_template.service.id
|
||||
).items == [
|
||||
job_2,
|
||||
job_1,
|
||||
]
|
||||
|
||||
|
||||
@@ -743,6 +743,21 @@ def test_get_jobs_with_limit_days(admin_request, sample_template):
|
||||
assert len(resp_json['data']) == 2
|
||||
|
||||
|
||||
def test_get_jobs_filters_jobs_from_contact_lists(admin_request, sample_template):
|
||||
contact_list = create_service_contact_list()
|
||||
|
||||
create_job(template=sample_template, contact_list_id=contact_list.id)
|
||||
job_without_contact_list = create_job(template=sample_template)
|
||||
|
||||
resp_json = admin_request.get(
|
||||
'job.get_jobs_by_service',
|
||||
service_id=sample_template.service_id,
|
||||
)
|
||||
|
||||
assert len(resp_json['data']) == 1
|
||||
assert resp_json['data'][0]['id'] == str(job_without_contact_list.id)
|
||||
|
||||
|
||||
def test_get_jobs_by_contact_list(admin_request, sample_template):
|
||||
contact_list = create_service_contact_list()
|
||||
create_job(template=sample_template)
|
||||
|
||||
Reference in New Issue
Block a user