diff --git a/app/main/views/dashboard.py b/app/main/views/dashboard.py index 02d0b5620..cc14d043b 100644 --- a/app/main/views/dashboard.py +++ b/app/main/views/dashboard.py @@ -141,7 +141,7 @@ def template_usage(service_id): @main.route("/services//monthly-billing-usage") @login_required @user_has_permissions('manage_service') -def usage(service_id): +def monthly_billing_usage(service_id): year, current_financial_year = requested_and_current_financial_year(request) free_sms_allowance = billing_api_client.get_free_sms_fragment_limit_for_year(service_id, year) @@ -160,7 +160,7 @@ def usage(service_id): )), selected_year=year, years=get_tuples_of_financial_years( - partial(url_for, '.usage', service_id=service_id), + partial(url_for, '.monthly_billing_usage', service_id=service_id), start=current_financial_year - 1, end=current_financial_year + 1, ), @@ -172,7 +172,7 @@ def usage(service_id): @main.route("/services//usage") @login_required @user_has_permissions('manage_service') -def ft_usage(service_id): +def usage(service_id): year, current_financial_year = requested_and_current_financial_year(request) free_sms_allowance = billing_api_client.get_free_sms_fragment_limit_for_year(service_id, year) @@ -191,7 +191,7 @@ def ft_usage(service_id): )), selected_year=year, years=get_tuples_of_financial_years( - partial(url_for, '.ft_usage', service_id=service_id), + partial(url_for, '.usage', service_id=service_id), start=current_financial_year - 1, end=current_financial_year + 1, ), diff --git a/tests/app/test_navigation.py b/tests/app/test_navigation.py index d83ea87a0..c2f887259 100644 --- a/tests/app/test_navigation.py +++ b/tests/app/test_navigation.py @@ -71,7 +71,7 @@ def test_excluded_navigation_items_are_properly_defined(navigation_instance): ]) def test_all_endpoints_are_covered(navigation_instance): for endpoint in all_endpoints: - if not endpoint == 'main.ft_usage': + if not endpoint == 'main.monthly_billing_usage': assert endpoint in ( navigation_instance.endpoints_with_navigation + navigation_instance.endpoints_without_navigation diff --git a/tests/conftest.py b/tests/conftest.py index 1797177c6..f9895f8c9 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -2194,7 +2194,7 @@ def mock_get_usage(mocker, service_one, fake_uuid): ] return mocker.patch( - 'app.billing_api_client.get_service_usage', side_effect=_get_usage) + 'app.billing_api_client.get_service_usage_ft', side_effect=_get_usage) @pytest.fixture(scope='function') @@ -2300,7 +2300,7 @@ def mock_get_billable_units(mocker): ] return mocker.patch( - 'app.billing_api_client.get_billable_units', side_effect=_get_usage) + 'app.billing_api_client.get_billable_units_ft', side_effect=_get_usage) @pytest.fixture(scope='function') @@ -2318,7 +2318,7 @@ def mock_get_future_usage(mocker, service_one, fake_uuid): ] return mocker.patch( - 'app.billing_api_client.get_service_usage', side_effect=_get_usage) + 'app.billing_api_client.get_service_usage_ft', side_effect=_get_usage) @pytest.fixture(scope='function') @@ -2327,7 +2327,7 @@ def mock_get_future_billable_units(mocker): return [] return mocker.patch( - 'app.billing_api_client.get_billable_units', side_effect=_get_usage) + 'app.billing_api_client.get_billable_units_ft', side_effect=_get_usage) @pytest.fixture(scope='function')