From e0bcad77f54963b308bc1cbab07744ca4db3a4cd Mon Sep 17 00:00:00 2001 From: Rebecca Law Date: Mon, 22 Jul 2019 14:34:15 +0100 Subject: [PATCH] Remove `ft` from method name and url, it doesn't add any meaning. --- app/main/views/dashboard.py | 4 ++-- app/notify_client/billing_api_client.py | 8 ++++---- tests/app/main/views/test_dashboard.py | 2 +- tests/conftest.py | 8 ++++---- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/app/main/views/dashboard.py b/app/main/views/dashboard.py index 13dba983f..499610b91 100644 --- a/app/main/views/dashboard.py +++ b/app/main/views/dashboard.py @@ -143,8 +143,8 @@ 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) - units = billing_api_client.get_billable_units_ft(service_id, year) - yearly_usage = billing_api_client.get_service_usage_ft(service_id, year) + units = billing_api_client.get_billable_units(service_id, year) + yearly_usage = billing_api_client.get_service_usage(service_id, year) usage_template = 'views/usage.html' if current_service.has_permission('letter'): diff --git a/app/notify_client/billing_api_client.py b/app/notify_client/billing_api_client.py index 7c8784ee3..204588430 100644 --- a/app/notify_client/billing_api_client.py +++ b/app/notify_client/billing_api_client.py @@ -3,15 +3,15 @@ from app.notify_client import NotifyAdminAPIClient class BillingAPIClient(NotifyAdminAPIClient): - def get_billable_units_ft(self, service_id, year): + def get_billable_units(self, service_id, year): return self.get( - '/service/{0}/billing/ft-monthly-usage'.format(service_id), + '/service/{0}/billing/monthly-usage'.format(service_id), params=dict(year=year) ) - def get_service_usage_ft(self, service_id, year=None): + def get_service_usage(self, service_id, year=None): return self.get( - '/service/{0}/billing/ft-yearly-usage-summary'.format(service_id), + '/service/{0}/billing/yearly-usage-summary'.format(service_id), params=dict(year=year) ) diff --git a/tests/app/main/views/test_dashboard.py b/tests/app/main/views/test_dashboard.py index cee7165fd..b639c8b80 100644 --- a/tests/app/main/views/test_dashboard.py +++ b/tests/app/main/views/test_dashboard.py @@ -876,7 +876,7 @@ def test_usage_page_displays_letters_ordered_by_postage( {'month': 'April', 'notification_type': 'letter', 'rate': 0.3, 'billing_units': 3, 'postage': 'second'}, {'month': 'April', 'notification_type': 'letter', 'rate': 0.5, 'billing_units': 1, 'postage': 'first'}, ] - mocker.patch('app.billing_api_client.get_billable_units_ft', return_value=billable_units_resp) + mocker.patch('app.billing_api_client.get_billable_units', return_value=billable_units_resp) service_one['permissions'].append('letter') page = client_request.get( 'main.usage', diff --git a/tests/conftest.py b/tests/conftest.py index c8e7ca1fb..0c485907e 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -2414,7 +2414,7 @@ def mock_get_usage(mocker, service_one, fake_uuid): ] return mocker.patch( - 'app.billing_api_client.get_service_usage_ft', side_effect=_get_usage) + 'app.billing_api_client.get_service_usage', side_effect=_get_usage) @pytest.fixture(scope='function') @@ -2508,7 +2508,7 @@ def mock_get_billable_units(mocker): ] return mocker.patch( - 'app.billing_api_client.get_billable_units_ft', side_effect=_get_usage) + 'app.billing_api_client.get_billable_units', side_effect=_get_usage) @pytest.fixture(scope='function') @@ -2526,7 +2526,7 @@ def mock_get_future_usage(mocker, service_one, fake_uuid): ] return mocker.patch( - 'app.billing_api_client.get_service_usage_ft', side_effect=_get_usage) + 'app.billing_api_client.get_service_usage', side_effect=_get_usage) @pytest.fixture(scope='function') @@ -2535,7 +2535,7 @@ def mock_get_future_billable_units(mocker): return [] return mocker.patch( - 'app.billing_api_client.get_billable_units_ft', side_effect=_get_usage) + 'app.billing_api_client.get_billable_units', side_effect=_get_usage) @pytest.fixture(scope='function')