Added a new error message when the letter is mising an address block.

Before deploying a change to template-preview to return a validation error for letters that are missing the address block, we need to add the new erorr message to admin.

Some content changes have been made to other messages.
The format of the message has changed.
This commit is contained in:
Rebecca Law
2020-01-10 14:42:56 +00:00
parent b3380ad7b5
commit 70276cb526
5 changed files with 64 additions and 18 deletions

View File

@@ -414,14 +414,21 @@ def test_get_letter_validation_error_for_unknown_error():
@pytest.mark.parametrize('error_message, expected_title, expected_content', [
('letter-not-a4-portrait-oriented', 'We cannot print your letter', 'A4 portrait size on page 2'),
('content-outside-printable-area', 'We cannot print your letter', 'outside the printable area on page 2'),
('letter-too-long', 'Your letter is too long', 'letter is 13 pages long.')
('letter-not-a4-portrait-oriented', 'Your letter is not A4 portrait size',
'You need to change the size or orientation of page 2. <br>Files must meet our '
'<a href="https://docs.notifications.service.gov.uk/documentation/images/notify-pdf-letter-spec-v2.4.pdf" '
'target="_blank">letter specification</a>.'),
('content-outside-printable-area', 'Your content is outside the printable area',
'You need to edit page 2.<br>Files must meet our '
'<a href="https://docs.notifications.service.gov.uk/documentation/images/notify-pdf-letter-spec-v2.4.pdf" '
'target="_blank">letter specification</a>.'),
('letter-too-long', 'Your letter is too long',
'Letters must be 10 pages or less. <br>Your letter is 13 pages long.')
])
def test_get_letter_validation_error_for_known_errors(
error_message,
expected_title,
expected_content,
error_message,
expected_title,
expected_content,
):
error = get_letter_validation_error(error_message, invalid_pages=[2], page_count=13)