mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-07-25 10:29:14 -04:00
fix usage page sms rate calculation
usage page used to make the assumption that the first row of the usage stats would always be SMS. This now isn't always the case, so make sure when working out the rate, it only looks at sms rows. Specifically, it takes the rate from the first stats row. This makes a big assumption that all the rows will have the same rate per financial year.
This commit is contained in:
@@ -2181,6 +2181,8 @@ def mock_get_template_statistics_for_template(mocker, service_one):
|
||||
def mock_get_usage(mocker, service_one, fake_uuid):
|
||||
def _get_usage(service_id, year=None):
|
||||
return [
|
||||
{"international": False, "rate": 0.00, "notification_type": "email",
|
||||
"rate_multiplier": None, "billing_units": 1000},
|
||||
{"international": False, "rate": 0.0165, "rate_multiplier": 1,
|
||||
"notification_type": "sms", "billing_units": 251500},
|
||||
{"international": True, "rate": 0.0165, "rate_multiplier": 1,
|
||||
@@ -2189,8 +2191,6 @@ def mock_get_usage(mocker, service_one, fake_uuid):
|
||||
"notification_type": "sms", "billing_units": 150},
|
||||
{"international": True, "rate": 0.0165, "rate_multiplier": 3,
|
||||
"notification_type": "sms", "billing_units": 30},
|
||||
{"international": False, "rate": 0.0165, "notification_type": "email",
|
||||
"rate_multiplier": None, "billing_units": 1000}
|
||||
]
|
||||
|
||||
return mocker.patch(
|
||||
|
||||
Reference in New Issue
Block a user