Add error messages for bad international addresses

Template preview started putting these in the metadata of the S3 object
in this pull request: https://github.com/alphagov/notifications-template-preview/pull/445

Specific error key is defined here:
800b48fce5/app/precompiled.py (L558)
This commit is contained in:
Chris Hill-Scott
2020-05-04 10:14:16 +01:00
parent 53724dacd1
commit 4cf218f5c8
2 changed files with 24 additions and 0 deletions

View File

@@ -669,6 +669,17 @@ LETTER_VALIDATION_MESSAGES = {
'Validation failed because the last line of the address is not a real UK postcode.'
),
},
'not-a-real-uk-postcode-or-country': {
'title': 'Theres a problem with the address for this letter',
'detail': (
'The last line of the address must be a UK postcode or '
'another country.'
),
'summary': (
'Validation failed because the last line of the address is '
'not a UK postcode or another country.'
),
},
'not-enough-address-lines': {
'title': 'Theres a problem with the address for this letter',
'detail': (

View File

@@ -508,6 +508,19 @@ def test_get_letter_validation_error_for_unknown_error():
'Validation failed because the last line of the address is not a real UK postcode.'
),
),
(
'not-a-real-uk-postcode-or-country',
None,
'Theres a problem with the address for this letter',
(
'The last line of the address must be a UK postcode or '
'another country.'
),
(
'Validation failed because the last line of the address is '
'not a UK postcode or another country.'
),
),
(
'not-enough-address-lines',
None,