Fix indentation and trailing commas

This will make the diffs introducing substative changes easier to read.
Consistent indenting and always having trailing commas on lists and
dictionaries makes for smaller diffs.
This commit is contained in:
Chris Hill-Scott
2020-01-10 17:04:50 +00:00
parent e3670de6c4
commit 72abd89fe0
2 changed files with 26 additions and 14 deletions

View File

@@ -569,32 +569,44 @@ def get_letter_printing_statement(status, created_at):
LETTER_VALIDATION_MESSAGES = {
'letter-not-a4-portrait-oriented': {
'title': 'Your letter is not A4 portrait size',
'detail': 'You need to change the size or orientation of {invalid_pages}. <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>.'
'detail': (
'You need to change the size or orientation of {invalid_pages}. <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': {
'title': 'Your content is outside the printable area',
'detail': 'You need to edit {invalid_pages}.<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>.'
'detail': (
'You need to edit {invalid_pages}.<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': {
'title': 'Your letter is too long',
'detail': 'Letters must be 10 pages or less. <br>Your letter is {page_count} pages long.'
'detail': (
'Letters must be 10 pages or less. <br>'
'Your letter is {page_count} pages long.'
),
},
'no-encoded-string': {
'title': 'Sanitise failed - No encoded string'
},
'unable-to-read-the-file': {
'title': 'Theres a problem with your file',
'detail': 'Notify cannot read this PDF.<br>Save a new copy of your file and try again.'
'detail': (
'Notify cannot read this PDF.'
'<br>Save a new copy of your file and try again.'
),
},
'address-is-empty': {
'title': 'The address block is empty',
'detail': 'You need to add a recipient address.<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>.'
'detail': (
'You need to add a recipient address.<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>.'
),
}
}

View File

@@ -426,9 +426,9 @@ def test_get_letter_validation_error_for_unknown_error():
'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)