allow 'accepted' as a proxy for created + sending as well as 'failed' for the three failure types when querying the api

This commit is contained in:
Leo Hemsted
2017-09-20 15:21:05 +01:00
parent c8ff45be2d
commit 4174c72f21
5 changed files with 25 additions and 18 deletions

View File

@@ -393,7 +393,7 @@ 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]"
"delivered, pending, failed, technical-failure, temporary-failure, permanent-failure, accepted]"
def test_get_all_notifications_filter_by_multiple_statuses(client, sample_template):

View File

@@ -26,7 +26,7 @@ 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]"
"technical-failure, temporary-failure, permanent-failure, accepted]"
with pytest.raises(ValidationError) as e:
validate({'status': invalid_statuses + valid_statuses}, get_notifications_request)
@@ -73,7 +73,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, sent, delivered, " \
"pending, failed, technical-failure, temporary-failure, permanent-failure]".format(
"pending, failed, technical-failure, temporary-failure, permanent-failure, accepted]".format(
invalid_status
) in error_messages