This commit is contained in:
Kenneth Kehl
2025-01-16 09:27:32 -08:00
parent 6f7202eb30
commit 1c77f8d60f

View File

@@ -10,11 +10,16 @@ def test_get_free_sms_fragment_limit_for_year_correct_endpoint(mocker, api_user_
expected_url = "/service/{}/billing/free-sms-fragment-limit".format(service_id)
client = BillingAPIClient()
mock_get = mocker.patch("app.notify_client.billing_api_client.BillingAPIClient.get")
mock_get = mocker.patch(
"app.notify_client.billing_api_client.BillingAPIClient.get",
return_value={"free_sms_fragment_limit": 0},
)
mocker.patch(
"app.notify_client.billing_api_client.redis_client.get", return_value=None
)
mocker.patch("app.notify_client.billing_api_client.redis_client.set")
client.get_free_sms_fragment_limit_for_year(service_id, year=1999)
mock_get.assert_called_once_with(
expected_url, params={"financial_year_start": 1999}