Add separate pages to view live/trial services

We have a lot of services now. Mostly we want to look at what live
services are doing. So loading up the trial mode services every time
slows things – generating, rendering and using the page – right down.

This commit adds two new pages, one to view only live services, and one
to view trial mode services.
This commit is contained in:
Chris Hill-Scott
2017-07-21 09:14:29 +01:00
parent 6dd4ae7410
commit 26b333512c
6 changed files with 239 additions and 38 deletions

View File

@@ -121,12 +121,31 @@ def mock_get_detailed_service_for_today(mocker, api_user_active):
@pytest.fixture(scope='function')
def mock_get_detailed_services(mocker, fake_uuid):
service_one = service_json(SERVICE_ONE_ID, "service_one", [fake_uuid], 1000, True, False)
service_one = service_json(
id_=SERVICE_ONE_ID,
name="service_one",
users=[fake_uuid],
message_limit=1000,
active=True,
restricted=False,
)
service_two = service_json(
id_=fake_uuid,
name="service_two",
users=[fake_uuid],
message_limit=1000,
active=True,
restricted=True,
)
service_one['statistics'] = {
'email': {'requested': 0, 'delivered': 0, 'failed': 0},
'sms': {'requested': 0, 'delivered': 0, 'failed': 0}
}
services = {'data': [service_one]}
service_two['statistics'] = {
'email': {'requested': 0, 'delivered': 0, 'failed': 0},
'sms': {'requested': 0, 'delivered': 0, 'failed': 0}
}
services = {'data': [service_one, service_two]}
return mocker.patch('app.service_api_client.get_services', return_value=services)