mirror of
https://github.com/GSA/notifications-api.git
synced 2026-08-16 20:48:37 -04:00
Add endpoint to return monthly notification stats per service
This will be used by notifications-admin to create a CSV report.
This commit is contained in:
@@ -3275,3 +3275,21 @@ def test_cancel_notification_for_service_updates_letter_if_still_time_to_cancel(
|
||||
notification_id=sample_letter_notification.id,
|
||||
)
|
||||
assert response['status'] == 'cancelled'
|
||||
|
||||
|
||||
def test_get_monthly_notification_data_by_service(mocker, admin_request):
|
||||
dao_mock = mocker.patch(
|
||||
'app.service.rest.fact_notification_status_dao.fetch_monthly_notification_statuses_per_service',
|
||||
return_value=[])
|
||||
|
||||
start_date = '2019-01-01'
|
||||
end_date = '2019-06-17'
|
||||
|
||||
response = admin_request.get(
|
||||
'service.get_monthly_notification_data_by_service',
|
||||
start_date=start_date,
|
||||
end_date=end_date
|
||||
)
|
||||
|
||||
dao_mock.assert_called_once_with(start_date, end_date)
|
||||
assert response == []
|
||||
|
||||
Reference in New Issue
Block a user