Tailor message-too-long error message

depending on the notification type.

Up until now, only sms messages could get message-too-long error,
but now we also need to validate the size of email messages, so
the message content needs to be tailored to the notification type.
This commit is contained in:
Pea Tyczynska
2020-10-05 18:57:21 +01:00
parent d39379062d
commit 9708b09ba3
5 changed files with 42 additions and 18 deletions

View File

@@ -318,7 +318,7 @@ def test_send_one_off_notification_raises_if_message_too_long(persist_mock, noti
send_one_off_notification(service.id, post_data)
assert e.value.message == f'Text messages cannot be longer than {SMS_CHAR_COUNT_LIMIT} characters. ' \
f'Your message is {1029} characters'
f'Your message is {1029} characters.'
def test_send_one_off_notification_fails_if_created_by_other_service(sample_template):