mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-07-23 09:29:14 -04:00
Fix trial mode allowance bug
This commit is contained in:
@@ -322,6 +322,14 @@ def get_dashboard_partials(service_id):
|
||||
free_sms_allowance = billing_api_client.get_free_sms_fragment_limit_for_year(
|
||||
current_service.id,
|
||||
)
|
||||
# These 2 calls will update the dashboard sms allowance count while in trial mode.
|
||||
billing_api_client.get_monthly_usage_for_service(
|
||||
service_id, get_current_financial_year()
|
||||
)
|
||||
billing_api_client.create_or_update_free_sms_fragment_limit(
|
||||
service_id, free_sms_fragment_limit=free_sms_allowance
|
||||
)
|
||||
|
||||
yearly_usage = billing_api_client.get_annual_usage_for_service(
|
||||
service_id,
|
||||
get_current_financial_year(),
|
||||
|
||||
@@ -1386,7 +1386,9 @@ def test_route_for_service_permissions(
|
||||
mock_has_no_jobs,
|
||||
mock_get_template_statistics,
|
||||
mock_get_service_statistics,
|
||||
mock_get_monthly_usage_for_service,
|
||||
mock_get_annual_usage_for_service,
|
||||
mock_create_or_update_free_sms_fragment_limit,
|
||||
mock_get_free_sms_fragment_limit,
|
||||
mock_get_inbound_sms_summary,
|
||||
):
|
||||
|
||||
@@ -2327,6 +2327,8 @@ def client_request(logged_in_client, mocker, service_one): # noqa (C901 too com
|
||||
"app.billing_api_client.create_or_update_free_sms_fragment_limit", autospec=True
|
||||
)
|
||||
|
||||
mocker.patch("app.billing_api_client.get_monthly_usage_for_service", autospec=True)
|
||||
|
||||
class ClientRequest:
|
||||
@staticmethod
|
||||
@contextmanager
|
||||
|
||||
Reference in New Issue
Block a user