mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-01 23:55:58 -05:00
Removed OrderedDict
Added missing assert in test
This commit is contained in:
@@ -18,7 +18,7 @@ def build_error_message(errors, schema):
|
|||||||
field = "'{}' {}".format(e.path[0], e.schema.get('validationMessage')) if e.schema.get(
|
field = "'{}' {}".format(e.path[0], e.schema.get('validationMessage')) if e.schema.get(
|
||||||
'validationMessage') else e.message
|
'validationMessage') else e.message
|
||||||
s = field.split("'")
|
s = field.split("'")
|
||||||
field = OrderedDict({"error": "ValidationError", "message": "{}{}".format(s[1], s[2])})
|
field = {"error": "ValidationError", "message": "{}{}".format(s[1], s[2])}
|
||||||
fields.append(field)
|
fields.append(field)
|
||||||
message = {
|
message = {
|
||||||
"status_code": 400,
|
"status_code": 400,
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ def test_check_template_is_for_notification_type_fails_when_template_type_does_n
|
|||||||
with pytest.raises(BadRequestError) as e:
|
with pytest.raises(BadRequestError) as e:
|
||||||
check_template_is_for_notification_type(notification_type=notification_type,
|
check_template_is_for_notification_type(notification_type=notification_type,
|
||||||
template_type=template_type)
|
template_type=template_type)
|
||||||
e.value.status_code == 400
|
assert e.value.status_code == 400
|
||||||
error_message = '{0} template is not suitable for {1} notification'.format(template_type, notification_type)
|
error_message = '{0} template is not suitable for {1} notification'.format(template_type, notification_type)
|
||||||
assert e.value.message == error_message
|
assert e.value.message == error_message
|
||||||
assert e.value.fields == [{'template': error_message}]
|
assert e.value.fields == [{'template': error_message}]
|
||||||
|
|||||||
Reference in New Issue
Block a user