mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-24 00:07:02 -04:00
Add monthly breakdown of usage
Basically: - shows all the months from start of given financial year to now or end of given financial year (whichever is earliest) - shows a breakdown of free and paid text messages for each of these months Depends on: - [x] https://github.com/alphagov/notifications-api/pull/699
This commit is contained in:
@@ -1172,14 +1172,26 @@ def mock_get_template_statistics_for_template(mocker, service_one):
|
||||
def mock_get_usage(mocker, service_one, fake_uuid):
|
||||
def _get_usage(service_id):
|
||||
return {'data': {
|
||||
"sms_count": 123,
|
||||
"email_count": 456
|
||||
"sms_count": 456123,
|
||||
"email_count": 123
|
||||
}}
|
||||
|
||||
return mocker.patch(
|
||||
'app.service_api_client.get_service_usage', side_effect=_get_usage)
|
||||
|
||||
|
||||
@pytest.fixture(scope='function')
|
||||
def mock_get_billable_units(mocker):
|
||||
def _get_usage(service_id, year):
|
||||
return {
|
||||
"April": 123,
|
||||
"March": 456123
|
||||
}
|
||||
|
||||
return mocker.patch(
|
||||
'app.service_api_client.get_billable_units', side_effect=_get_usage)
|
||||
|
||||
|
||||
@pytest.fixture(scope='function')
|
||||
def mock_events(mocker):
|
||||
def _create_event(event_type, event_data):
|
||||
|
||||
Reference in New Issue
Block a user