mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-03 01:41:05 -05:00
Update validators to use is_message_too_long()
- update check_sms_content_char_count to use the SMSTemplate.is_message_too_long function, and updated the error message to align with the message returned by the admin app. - Update the the code used by version 1 of the api to use the validate_template method. - I did find a couple of services still using the old api, however, this change should not affect them as I checked the messages being sent and they are not too long. - We will be sending a message to them to see if they can upgrade. - Update the log message for authenication to include the URL - makes it easier to track if a service is using version 1 of the api.
This commit is contained in:
@@ -99,8 +99,8 @@ def test_send_notification_invalid_template_id(notify_api, sample_template, mock
|
||||
|
||||
json_resp = json.loads(response.get_data(as_text=True))
|
||||
mocked.assert_not_called()
|
||||
assert response.status_code == 404
|
||||
test_string = 'No result found'
|
||||
assert response.status_code == 400
|
||||
test_string = 'Template not found'
|
||||
assert test_string in json_resp['message']
|
||||
|
||||
|
||||
@@ -315,8 +315,8 @@ def test_should_not_allow_template_from_another_service(notify_api,
|
||||
|
||||
json_resp = json.loads(response.get_data(as_text=True))
|
||||
mocked.assert_not_called()
|
||||
assert response.status_code == 404
|
||||
test_string = 'No result found'
|
||||
assert response.status_code == 400
|
||||
test_string = 'Template not found'
|
||||
assert test_string in json_resp['message']
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user