mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-07-25 10:29:14 -04:00
Merge pull request #3065 from alphagov/rename-endpoint
Remove ft from method and url, it doesn't add any meaning.
This commit is contained in:
@@ -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'):
|
||||
|
||||
@@ -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)
|
||||
)
|
||||
|
||||
|
||||
@@ -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',
|
||||
|
||||
@@ -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')
|
||||
|
||||
Reference in New Issue
Block a user