mirror of
https://github.com/GSA/notifications-api.git
synced 2026-01-31 23:26:23 -05:00
Use status_code in error response.
Remove code.
This commit is contained in:
@@ -55,7 +55,6 @@ def test_post_sms_notification_returns_404_and_missing_template(notify_api, samp
|
||||
assert response.headers['Content-type'] == 'application/json'
|
||||
|
||||
error_json = json.loads(response.get_data(as_text=True))
|
||||
assert error_json['code'] == 10400
|
||||
assert error_json['message'] == 'Template not found'
|
||||
assert error_json['fields'] == [{'template': 'Template not found'}]
|
||||
|
||||
@@ -76,7 +75,7 @@ def test_post_sms_notification_returns_403_and_well_formed_auth_error(notify_api
|
||||
assert response.status_code == 401
|
||||
assert response.headers['Content-type'] == 'application/json'
|
||||
error_resp = json.loads(response.get_data(as_text=True))
|
||||
assert error_resp['code'] == 401
|
||||
assert error_resp['status_code'] == 401
|
||||
assert error_resp['message'] == 'Unauthorized, authentication token must be provided'
|
||||
assert error_resp['fields'] == {'token': ['Unauthorized, authentication token must be provided']}
|
||||
|
||||
@@ -98,6 +97,6 @@ def test_post_sms_notification_returns_400_and_for_schema_problems(notify_api, s
|
||||
assert response.status_code == 400
|
||||
assert response.headers['Content-type'] == 'application/json'
|
||||
error_resp = json.loads(response.get_data(as_text=True))
|
||||
assert error_resp['code'] == '1001'
|
||||
assert error_resp['status_code'] == 400
|
||||
assert error_resp['message'] == 'Validation error occurred - POST v2/notifications/sms'
|
||||
assert error_resp['fields'] == [{"template_id": "is a required property"}]
|
||||
|
||||
Reference in New Issue
Block a user