mirror of
https://github.com/GSA/notifications-api.git
synced 2026-08-18 21:48:49 -04:00
Add "charged_units" to usage APIs
This commit is contained in:
@@ -177,6 +177,7 @@ def test_get_yearly_usage_by_monthly_from_ft_billing(admin_request, notify_db_se
|
||||
assert letter_row["postage"] == "second"
|
||||
assert letter_row["cost"] == 9.9
|
||||
assert letter_row["free_chargeable_units"] == 0
|
||||
assert letter_row["charged_units"] == 30
|
||||
|
||||
assert sms_row["month"] == "April"
|
||||
assert sms_row["notification_type"] == "sms"
|
||||
@@ -187,6 +188,7 @@ def test_get_yearly_usage_by_monthly_from_ft_billing(admin_request, notify_db_se
|
||||
# free allowance is 4, so (30 - 4) * 0.162
|
||||
assert sms_row["cost"] == 4.212
|
||||
assert sms_row["free_chargeable_units"] == 4
|
||||
assert sms_row["charged_units"] == 26
|
||||
|
||||
|
||||
def set_up_yearly_data():
|
||||
@@ -260,6 +262,7 @@ def test_get_yearly_billing_usage_summary_from_ft_billing(admin_request, notify_
|
||||
assert json_response[0]['letter_total'] == 0
|
||||
assert json_response[0]['cost'] == 0
|
||||
assert json_response[0]['free_chargeable_units'] == 0
|
||||
assert json_response[0]['charged_units'] == 275
|
||||
|
||||
assert json_response[1]['notification_type'] == 'letter'
|
||||
assert json_response[1]['billing_units'] == 275
|
||||
@@ -268,6 +271,7 @@ def test_get_yearly_billing_usage_summary_from_ft_billing(admin_request, notify_
|
||||
assert json_response[1]['letter_total'] == 90.75
|
||||
assert json_response[1]['cost'] == 90.75
|
||||
assert json_response[1]['free_chargeable_units'] == 0
|
||||
assert json_response[1]['charged_units'] == 275
|
||||
|
||||
assert json_response[2]['notification_type'] == 'sms'
|
||||
assert json_response[2]['billing_units'] == 825
|
||||
@@ -276,3 +280,4 @@ def test_get_yearly_billing_usage_summary_from_ft_billing(admin_request, notify_
|
||||
assert json_response[2]['letter_total'] == 0
|
||||
assert json_response[2]['cost'] == 13.3002
|
||||
assert json_response[2]['free_chargeable_units'] == 4
|
||||
assert json_response[2]['charged_units'] == 821
|
||||
|
||||
Reference in New Issue
Block a user