mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-07-25 10:29:14 -04:00
Stop passing in today_only for the get_service_statistics method.
We now only ever call it with False. To remove it from the api call will require a change in the API so will do that at another time.
This commit is contained in:
@@ -37,20 +37,15 @@ def test_client_gets_service(mocker):
|
||||
mock_get.assert_called_once_with('/service/foo')
|
||||
|
||||
|
||||
@pytest.mark.parametrize('today_only, limit_days', [
|
||||
(False, None),
|
||||
(False, 30),
|
||||
])
|
||||
def test_client_gets_service_statistics(mocker, today_only, limit_days):
|
||||
@pytest.mark.parametrize('limit_days', [None, 30])
|
||||
def test_client_gets_service_statistics(mocker, limit_days):
|
||||
client = ServiceAPIClient()
|
||||
mock_get = mocker.patch.object(client, 'get', return_value={'data': {'a': 'b'}})
|
||||
|
||||
ret = client.get_service_statistics('foo', today_only, limit_days)
|
||||
ret = client.get_service_statistics('foo', limit_days)
|
||||
|
||||
assert ret == {'a': 'b'}
|
||||
mock_get.assert_called_once_with('/service/foo/statistics', params={
|
||||
'today_only': today_only, 'limit_days': limit_days
|
||||
})
|
||||
mock_get.assert_called_once_with('/service/foo/statistics', params={'limit_days': limit_days})
|
||||
|
||||
|
||||
def test_client_only_updates_allowed_attributes(mocker):
|
||||
|
||||
@@ -502,7 +502,7 @@ def mock_get_service(mocker, api_user_active):
|
||||
|
||||
@pytest.fixture(scope='function')
|
||||
def mock_get_service_statistics(mocker, api_user_active):
|
||||
def _get(service_id, today_only, limit_days=None):
|
||||
def _get(service_id, limit_days=None):
|
||||
return {
|
||||
'email': {'requested': 0, 'delivered': 0, 'failed': 0},
|
||||
'sms': {'requested': 0, 'delivered': 0, 'failed': 0},
|
||||
|
||||
Reference in New Issue
Block a user