mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-09-05 21:38:24 -04:00
Use the revise api endpoints without current-year parameter
This commit is contained in:
@@ -27,17 +27,6 @@ def test_get_get_service_usage_calls_correct_endpoint(mocker, api_user_active):
|
||||
mock_get.assert_called_once_with(expected_url, params={'year': 2017})
|
||||
|
||||
|
||||
def test_get_free_sms_fragment_limit_for_current_year_correct_endpoint(mocker, api_user_active):
|
||||
service_id = uuid.uuid4()
|
||||
expected_url = '/service/{}/billing/free-sms-fragment-limit/current-year'.format(service_id)
|
||||
client = BillingAPIClient()
|
||||
|
||||
mock_get = mocker.patch('app.notify_client.billing_api_client.BillingAPIClient.get')
|
||||
|
||||
client.get_free_sms_fragment_limit_for_year(service_id)
|
||||
mock_get.assert_called_once_with(expected_url)
|
||||
|
||||
|
||||
def test_get_free_sms_fragment_limit_for_year_correct_endpoint(mocker, api_user_active):
|
||||
service_id = uuid.uuid4()
|
||||
expected_url = '/service/{}/billing/free-sms-fragment-limit'.format(service_id)
|
||||
@@ -51,11 +40,11 @@ def test_get_free_sms_fragment_limit_for_year_correct_endpoint(mocker, api_user_
|
||||
|
||||
def test_post_free_sms_fragment_limit_for_current_year_endpoint(mocker, api_user_active):
|
||||
service_id = uuid.uuid4()
|
||||
sms_limit_data = {'free_sms_fragment_limit': 1111}
|
||||
sms_limit_data = {'free_sms_fragment_limit': 1111, 'financial_year_start': None}
|
||||
mock_post = mocker.patch('app.notify_client.billing_api_client.BillingAPIClient.post')
|
||||
client = BillingAPIClient()
|
||||
|
||||
client.create_or_update_free_sms_fragment_limit_for_year(service_id=service_id, free_sms_fragment_limit=1111)
|
||||
client.create_or_update_free_sms_fragment_limit(service_id=service_id, free_sms_fragment_limit=1111)
|
||||
|
||||
mock_post.assert_called_once_with(
|
||||
url='/service/{}/billing/free-sms-fragment-limit'.format(service_id),
|
||||
@@ -69,9 +58,9 @@ def test_post_free_sms_fragment_limit_for_year_endpoint(mocker, api_user_active)
|
||||
mock_post = mocker.patch('app.notify_client.billing_api_client.BillingAPIClient.post')
|
||||
client = BillingAPIClient()
|
||||
|
||||
client.create_or_update_free_sms_fragment_limit_for_year(service_id=service_id,
|
||||
free_sms_fragment_limit=1111,
|
||||
year=2017)
|
||||
client.create_or_update_free_sms_fragment_limit(service_id=service_id,
|
||||
free_sms_fragment_limit=1111,
|
||||
year=2017)
|
||||
mock_post.assert_called_once_with(
|
||||
url='/service/{}/billing/free-sms-fragment-limit'.format(service_id),
|
||||
data=sms_limit_data
|
||||
|
||||
Reference in New Issue
Block a user