diff --git a/app/config.py b/app/config.py index 5dd33557e..4e4a77aec 100644 --- a/app/config.py +++ b/app/config.py @@ -187,7 +187,6 @@ class Development(Config): NOTIFY_ENVIRONMENT = 'development' NOTIFICATION_QUEUE_PREFIX = 'development' DEBUG = True - SQLALCHEMY_ECHO = False CELERY_QUEUES = Config.CELERY_QUEUES + [ Queue('db-sms', Exchange('default'), routing_key='db-sms'), Queue('priority', Exchange('default'), routing_key='priority'), diff --git a/app/models.py b/app/models.py index d54f413e4..a4bb1d5cf 100644 --- a/app/models.py +++ b/app/models.py @@ -572,6 +572,7 @@ class VerifyCode(db.Model): NOTIFICATION_CREATED = 'created' NOTIFICATION_SENDING = 'sending' +NOTIFICATION_SENT = 'sent' NOTIFICATION_DELIVERED = 'delivered' NOTIFICATION_PENDING = 'pending' NOTIFICATION_FAILED = 'failed' @@ -586,6 +587,7 @@ NOTIFICATION_STATUS_TYPES_FAILED = [ ] NOTIFICATION_STATUS_TYPES_COMPLETED = [ + NOTIFICATION_SENT, NOTIFICATION_DELIVERED, NOTIFICATION_FAILED, NOTIFICATION_TECHNICAL_FAILURE, @@ -595,6 +597,7 @@ NOTIFICATION_STATUS_TYPES_COMPLETED = [ NOTIFICATION_STATUS_TYPES_BILLABLE = [ NOTIFICATION_SENDING, + NOTIFICATION_SENT, NOTIFICATION_DELIVERED, NOTIFICATION_FAILED, NOTIFICATION_TECHNICAL_FAILURE, @@ -605,6 +608,7 @@ NOTIFICATION_STATUS_TYPES_BILLABLE = [ NOTIFICATION_STATUS_TYPES = [ NOTIFICATION_CREATED, NOTIFICATION_SENDING, + NOTIFICATION_SENT, NOTIFICATION_DELIVERED, NOTIFICATION_PENDING, NOTIFICATION_FAILED, diff --git a/tests/app/dao/test_provider_statistics_dao.py b/tests/app/dao/test_provider_statistics_dao.py index e3249ec64..54e429b0e 100644 --- a/tests/app/dao/test_provider_statistics_dao.py +++ b/tests/app/dao/test_provider_statistics_dao.py @@ -26,8 +26,8 @@ def test_get_fragment_count_separates_sms_and_email(notify_db, sample_template, def test_get_fragment_count_filters_on_status(notify_db, sample_template): for status in NOTIFICATION_STATUS_TYPES: noti_hist(notify_db, sample_template, status=status) - # sending, delivered, failed, technical-failure, temporary-failure, permanent-failure - assert get_fragment_count(sample_template.service_id)['sms_count'] == 6 + # sending, sent, delivered, failed, technical-failure, temporary-failure, permanent-failure + assert get_fragment_count(sample_template.service_id)['sms_count'] == 7 def test_get_fragment_count_filters_on_service_id(notify_db, sample_template, service_factory): diff --git a/tests/app/v2/notifications/test_get_notifications.py b/tests/app/v2/notifications/test_get_notifications.py index 5c2c31af3..6e3b72ed2 100644 --- a/tests/app/v2/notifications/test_get_notifications.py +++ b/tests/app/v2/notifications/test_get_notifications.py @@ -307,8 +307,8 @@ def test_get_all_notifications_filter_by_status_invalid_status(client, sample_no assert json_response['status_code'] == 400 assert len(json_response['errors']) == 1 - assert json_response['errors'][0]['message'] == "status elephant is not one of [created, sending, delivered, " \ - "pending, failed, technical-failure, temporary-failure, permanent-failure]" + assert json_response['errors'][0]['message'] == "status elephant is not one of [created, sending, sent, " \ + "delivered, pending, failed, technical-failure, temporary-failure, permanent-failure]" def test_get_all_notifications_filter_by_multiple_statuses(client, notify_db, notify_db_session): diff --git a/tests/app/v2/notifications/test_notification_schemas.py b/tests/app/v2/notifications/test_notification_schemas.py index 44a743a1a..04c32e1c7 100644 --- a/tests/app/v2/notifications/test_notification_schemas.py +++ b/tests/app/v2/notifications/test_notification_schemas.py @@ -27,7 +27,7 @@ def test_get_notifications_request_invalid_statuses( invalid_statuses, valid_statuses ): partial_error_status = "is not one of " \ - "[created, sending, delivered, pending, failed, " \ + "[created, sending, sent, delivered, pending, failed, " \ "technical-failure, temporary-failure, permanent-failure]" with pytest.raises(ValidationError) as e: @@ -74,7 +74,7 @@ def test_get_notifications_request_invalid_statuses_and_template_types(): error_messages = [error['message'] for error in errors] for invalid_status in ["elephant", "giraffe"]: - assert "status {} is not one of [created, sending, delivered, " \ + assert "status {} is not one of [created, sending, sent, delivered, " \ "pending, failed, technical-failure, temporary-failure, permanent-failure]".format( invalid_status ) in error_messages