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:30:14 +01:00
parent c8ff45be2d
commit 4174c72f21
5 changed files with 25 additions and 18 deletions
@@ -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