mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-25 08:44:23 -04:00
Get notification count from api instead of list of notifications
when checking if job can be cancelled. This makes query lighter, less likely to fall over if job is large and removes pagination bug.
This commit is contained in:
@@ -118,3 +118,11 @@ def test_update_notification_to_cancelled(mocker):
|
||||
url='/service/foo/notifications/bar/cancel',
|
||||
data={},
|
||||
)
|
||||
|
||||
|
||||
def test_get_notification_count_for_job_id(mocker):
|
||||
mock_get = mocker.patch('app.notify_client.notification_api_client.NotificationApiClient.get')
|
||||
NotificationApiClient().get_notification_count_for_job_id(service_id='foo', job_id='bar')
|
||||
mock_get.assert_called_once_with(
|
||||
url='/service/foo/job/bar/notification_count',
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user