From d80fef8fe87613328285410a7124f70603502dbd Mon Sep 17 00:00:00 2001 From: "Pea M. Tyczynska" Date: Wed, 18 Mar 2020 13:37:32 +0000 Subject: [PATCH] Update postcode validation error message --- app/v2/notifications/post_notifications.py | 2 +- tests/app/v2/notifications/test_post_letter_notifications.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/v2/notifications/post_notifications.py b/app/v2/notifications/post_notifications.py index c19950026..5e8e1eac3 100644 --- a/app/v2/notifications/post_notifications.py +++ b/app/v2/notifications/post_notifications.py @@ -271,7 +271,7 @@ def process_letter_notification(*, letter_data, api_key, template, reply_to_text postcode = letter_data['personalisation']['postcode'] if not is_a_real_uk_postcode(postcode): - raise ValidationError(message='A real UK postcode is required.') + raise ValidationError(message='Must be a real UK postcode') test_key = api_key.key_type == KEY_TYPE_TEST diff --git a/tests/app/v2/notifications/test_post_letter_notifications.py b/tests/app/v2/notifications/test_post_letter_notifications.py index 9ecc9ce4b..305506d9f 100644 --- a/tests/app/v2/notifications/test_post_letter_notifications.py +++ b/tests/app/v2/notifications/test_post_letter_notifications.py @@ -164,7 +164,7 @@ def test_post_letter_notification_throws_error_for_bad_postcode( assert error_json['status_code'] == 400 assert error_json['errors'] == [{ 'error': 'ValidationError', - 'message': 'A real UK postcode is required.' + 'message': 'Must be a real UK postcode' }]