mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-03 09:51:11 -05:00
Remove link from v2 error response
This commit is contained in:
@@ -33,7 +33,6 @@ def test_post_sms_json_schema_bad_uuid_and_missing_phone_number():
|
||||
assert {"phone_number": "is a required property"} in error['fields']
|
||||
assert {"template_id": "not a valid UUID"} in error['fields']
|
||||
assert error.get('code') == '1001'
|
||||
assert error.get('link', None) is not None
|
||||
|
||||
|
||||
def test_post_sms_schema_with_personalisation_that_is_not_a_dict():
|
||||
@@ -50,7 +49,6 @@ def test_post_sms_schema_with_personalisation_that_is_not_a_dict():
|
||||
assert len(error.get('fields')) == 1
|
||||
assert error['fields'][0] == {"personalisation": "should contain key value pairs"}
|
||||
assert error.get('code') == '1001'
|
||||
assert error.get('link', None) == 'link to error documentation (not yet implemented)'
|
||||
|
||||
|
||||
valid_response = {
|
||||
@@ -87,6 +85,5 @@ def test_post_sms_response_schema_missing_uri():
|
||||
validate(j, post_sms_response)
|
||||
error = json.loads(e.value.message)
|
||||
assert '1001' == error['code']
|
||||
assert 'link to error documentation (not yet implemented)' == error['link']
|
||||
assert 'Validation error occurred - response v2/notifications/sms' == error['message']
|
||||
assert [{"uri": "is a required property"}] == error['fields']
|
||||
|
||||
@@ -58,7 +58,6 @@ def test_post_sms_notification_returns_404_and_missing_template(notify_api, samp
|
||||
assert error_json['code'] == 10400
|
||||
assert error_json['message'] == 'Template not found'
|
||||
assert error_json['fields'] == [{'template': 'Template not found'}]
|
||||
assert error_json['link'] == 'link to documentation'
|
||||
|
||||
|
||||
def test_post_sms_notification_returns_403_and_well_formed_auth_error(notify_api, sample_template):
|
||||
@@ -80,7 +79,6 @@ def test_post_sms_notification_returns_403_and_well_formed_auth_error(notify_api
|
||||
assert error_resp['code'] == 401
|
||||
assert error_resp['message'] == 'Unauthorized, authentication token must be provided'
|
||||
assert error_resp['fields'] == {'token': ['Unauthorized, authentication token must be provided']}
|
||||
assert error_resp['link'] == 'link to docs'
|
||||
|
||||
|
||||
def test_post_sms_notification_returns_400_and_for_schema_problems(notify_api, sample_template):
|
||||
@@ -102,5 +100,4 @@ def test_post_sms_notification_returns_400_and_for_schema_problems(notify_api, s
|
||||
error_resp = json.loads(response.get_data(as_text=True))
|
||||
assert error_resp['code'] == '1001'
|
||||
assert error_resp['message'] == 'Validation error occurred - POST v2/notifications/sms'
|
||||
assert error_resp['link'] == "link to error documentation (not yet implemented)"
|
||||
assert error_resp['fields'] == [{"template_id": "is a required property"}]
|
||||
|
||||
Reference in New Issue
Block a user