Add new virus scan statuses

Added the following new notification statuses:
* pending_virus_check
* virus_scan_failed

If we decide to remove these statuses in future, we will need to replace
them with a different status in the notifications and
Notification_history tables where they are referenced, so
pending-virus-check will be replaced with sending, and virus-scan-failed
will be replaced with permanent-failure.
This commit is contained in:
Katie Smith
2018-03-12 11:46:48 +00:00
parent 1523d28ec2
commit 43c63a1644
4 changed files with 38 additions and 3 deletions

View File

@@ -422,7 +422,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, sent, " \
"delivered, pending, failed, technical-failure, temporary-failure, permanent-failure, accepted, received]"
"delivered, pending, failed, technical-failure, temporary-failure, permanent-failure, pending-virus-check, " \
"virus-scan-failed, accepted, received]"
def test_get_all_notifications_filter_by_multiple_statuses(client, sample_template):

View File

@@ -43,7 +43,8 @@ def test_get_notifications_request_invalid_statuses(
):
partial_error_status = "is not one of " \
"[created, sending, sent, delivered, pending, failed, " \
"technical-failure, temporary-failure, permanent-failure, accepted, received]"
"technical-failure, temporary-failure, permanent-failure, pending-virus-check, " \
"virus-scan-failed, accepted, received]"
with pytest.raises(ValidationError) as e:
validate({'status': invalid_statuses + valid_statuses}, get_notifications_request)
@@ -90,7 +91,8 @@ 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, sent, delivered, " \
"pending, failed, technical-failure, temporary-failure, permanent-failure, accepted, received]".format(
"pending, failed, technical-failure, temporary-failure, permanent-failure, " \
"pending-virus-check, virus-scan-failed, accepted, received]".format(
invalid_status
) in error_messages