mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-24 16:24:08 -04:00
Add new report to show monthly notification stats for each service
This report will be used by the engagement team. There is a form to give a start and end date for the report, and the form is then downloaded as a CSV file when the form is submitted.
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import uuid
|
||||
from datetime import date
|
||||
from unittest.mock import patch
|
||||
|
||||
import pytest
|
||||
@@ -6,6 +7,7 @@ import werkzeug
|
||||
|
||||
from app.models.service import Service
|
||||
from app.notify_client import NotifyAdminAPIClient
|
||||
from app.notify_client.notification_api_client import notification_api_client
|
||||
from tests import service_json
|
||||
from tests.conftest import api_user_active, platform_admin_user, set_config
|
||||
|
||||
@@ -102,3 +104,16 @@ def test_generate_headers_sets_request_id_if_in_request_context(app_):
|
||||
}
|
||||
assert headers['X-B3-TraceId'] == request_context.request.request_id
|
||||
assert headers['X-B3-SpanId'] == request_context.request.span_id
|
||||
|
||||
|
||||
def test_get_notification_status_by_service(mocker):
|
||||
mock_get = mocker.patch.object(notification_api_client, 'get')
|
||||
start_date = date(2019, 4, 1)
|
||||
end_date = date(2019, 4, 30)
|
||||
|
||||
notification_api_client.get_notification_status_by_service(start_date, end_date)
|
||||
|
||||
mock_get.assert_called_once_with(
|
||||
url='service/monthly-data-by-service',
|
||||
params={'start_date': '2019-04-01', 'end_date': '2019-04-30'}
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user