mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-01 15:46:07 -05:00
Use service_id in the query to make it safer, also use named parameters
This commit is contained in:
@@ -566,8 +566,9 @@ def test_get_all_notifications_for_job_returns_correct_format(
|
||||
def test_get_notification_count_for_job_id(admin_request, mocker):
|
||||
mock_dao = mocker.patch('app.job.rest.dao_get_notification_count_for_job_id', return_value=3)
|
||||
job_id = uuid.uuid4()
|
||||
response = admin_request.get('job.get_notification_count_for_job_id', service_id=uuid.uuid4(), job_id=job_id)
|
||||
mock_dao.assert_called_once_with(str(job_id))
|
||||
service_id = uuid.uuid4()
|
||||
response = admin_request.get('job.get_notification_count_for_job_id', service_id=service_id, job_id=job_id)
|
||||
mock_dao.assert_called_once_with(service_id=service_id, job_id=str(job_id))
|
||||
assert response["count"] == 3
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user