mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-20 14:29:51 -04:00
Add usage to the dashboard
Takes the number of emails and SMS fragments sent from: https://github.com/alphagov/notifications-api/pull/273 Using these numbers it’s possible to show: - how much of your allowance is left - or how much you have spent For now the allowance and rates are hard coded. Only for users that have manage service.
This commit is contained in:
@@ -898,6 +898,19 @@ def mock_get_template_statistics(mocker, service_one, fake_uuid):
|
||||
'app.template_statistics_client.get_template_statistics_for_service', side_effect=_get_stats)
|
||||
|
||||
|
||||
@pytest.fixture(scope='function')
|
||||
def mock_get_usage(mocker, service_one, fake_uuid):
|
||||
|
||||
def _get_usage(service_id):
|
||||
return {'data': {
|
||||
"sms_count": 123,
|
||||
"email_count": 456
|
||||
}}
|
||||
|
||||
return mocker.patch(
|
||||
'app.service_api_client.get_service_usage', side_effect=_get_usage)
|
||||
|
||||
|
||||
@pytest.fixture(scope='function')
|
||||
def mock_events(mocker):
|
||||
|
||||
|
||||
Reference in New Issue
Block a user