From d572c7228d4c4fb84530b8a33df7bd4596e01d8b Mon Sep 17 00:00:00 2001 From: Katie Smith Date: Fri, 25 Feb 2022 12:01:20 +0000 Subject: [PATCH 1/2] Allow the free SMS fragment limit to be 0 This updates the schema so that the free allowance has a minimum value of 0 instead of 1. --- app/billing/billing_schemas.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/billing/billing_schemas.py b/app/billing/billing_schemas.py index 9ab8cedbf..6c9180547 100644 --- a/app/billing/billing_schemas.py +++ b/app/billing/billing_schemas.py @@ -6,7 +6,7 @@ create_or_update_free_sms_fragment_limit_schema = { "type": "object", "title": "Create", "properties": { - "free_sms_fragment_limit": {"type": "integer", "minimum": 1}, + "free_sms_fragment_limit": {"type": "integer", "minimum": 0}, }, "required": ["free_sms_fragment_limit"] } From c9dafa03720da2272c7bb7de640daee18213954b Mon Sep 17 00:00:00 2001 From: Katie Smith Date: Fri, 25 Feb 2022 12:17:37 +0000 Subject: [PATCH 2/2] Remove unused test code Notifications don't have a `scheduled_for` attribute, and the test function deleted isn't used anywhere. --- tests/app/billing/test_billing.py | 4 ---- tests/app/db.py | 1 - tests/app/v2/notifications/test_get_notifications.py | 2 -- 3 files changed, 7 deletions(-) diff --git a/tests/app/billing/test_billing.py b/tests/app/billing/test_billing.py index b1c5b7ee5..eba44a836 100644 --- a/tests/app/billing/test_billing.py +++ b/tests/app/billing/test_billing.py @@ -29,10 +29,6 @@ IN_MAY_2016 = datetime(2016, 5, 10, 23, 00, 00) IN_JUN_2016 = datetime(2016, 6, 3, 23, 00, 00) -def _assert_dict_equals(actual, expected_dict): - assert actual == expected_dict - - def test_create_update_free_sms_fragment_limit_invalid_schema(client, sample_service): response = client.post('service/{}/billing/free-sms-fragment-limit'.format(sample_service.id), diff --git a/tests/app/db.py b/tests/app/db.py index eaacbe676..a7e412806 100644 --- a/tests/app/db.py +++ b/tests/app/db.py @@ -260,7 +260,6 @@ def create_notification( rate_multiplier=None, international=False, phone_prefix=None, - scheduled_for=None, normalised_to=None, one_off=False, reply_to_text=None, diff --git a/tests/app/v2/notifications/test_get_notifications.py b/tests/app/v2/notifications/test_get_notifications.py index 898c93740..299b1d6e2 100644 --- a/tests/app/v2/notifications/test_get_notifications.py +++ b/tests/app/v2/notifications/test_get_notifications.py @@ -20,7 +20,6 @@ def test_get_notification_by_id_returns_200( template=sample_template, billable_units=billable_units, sent_by=provider, - scheduled_for="2017-05-12 15:15" ) # another @@ -28,7 +27,6 @@ def test_get_notification_by_id_returns_200( template=sample_template, billable_units=billable_units, sent_by=provider, - scheduled_for="2017-06-12 15:15" ) auth_header = create_service_authorization_header(service_id=sample_notification.service_id)