use new detailed service endpoint for dashboard totals

we don't want to use the old statistics endpoints any more
also a couple of quality of life changes
* moves some logic out of the _totals.html template
* tidies up statistics_utils
This commit is contained in:
Leo Hemsted
2016-07-19 17:10:48 +01:00
parent 4451a8634d
commit 3e6eedd079
5 changed files with 49 additions and 45 deletions

View File

@@ -13,11 +13,11 @@ class TestClient(FlaskClient):
session['user_id'] = user.id
session['_fresh'] = True
if mocker:
mocker.patch('app.user_api_client.get_user', return_value=user)
mocker.patch('app.events_api_client.create_event')
if mocker and service:
session['service_id'] = service['id']
mocker.patch('app.service_api_client.get_service', return_value={'data': service})
get_user_mock = mocker.patch('app.user_api_client.get_user', return_value=user)
create_event_mock = mocker.patch('app.events_api_client.create_event')
if service:
session['service_id'] = service['id']
get_service_mock = mocker.patch('app.service_api_client.get_service', return_value={'data': service})
login_user(user, remember=True)
def login_fresh(self):