From 72abd89fe0b4616f6b2fb37380863c75cb293ca5 Mon Sep 17 00:00:00 2001 From: Chris Hill-Scott Date: Fri, 10 Jan 2020 17:04:50 +0000 Subject: [PATCH] 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. --- app/utils.py | 34 +++++++++++++++++++++++----------- tests/app/test_utils.py | 6 +++--- 2 files changed, 26 insertions(+), 14 deletions(-) diff --git a/app/utils.py b/app/utils.py index af2537a05..bacce22b8 100644 --- a/app/utils.py +++ b/app/utils.py @@ -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}.
' - 'Files must meet our letter specification.' + 'detail': ( + 'You need to change the size or orientation of {invalid_pages}.
' + 'Files must meet our letter specification.' + ), }, 'content-outside-printable-area': { 'title': 'Your content is outside the printable area', - 'detail': 'You need to edit {invalid_pages}.
' - 'Files must meet our letter specification.' + 'detail': ( + 'You need to edit {invalid_pages}.
' + 'Files must meet our letter specification.' + ), }, 'letter-too-long': { 'title': 'Your letter is too long', - 'detail': 'Letters must be 10 pages or less.
Your letter is {page_count} pages long.' + 'detail': ( + 'Letters must be 10 pages or less.
' + 'Your letter is {page_count} pages long.' + ), }, 'no-encoded-string': { 'title': 'Sanitise failed - No encoded string' }, 'unable-to-read-the-file': { 'title': 'There’s a problem with your file', - 'detail': 'Notify cannot read this PDF.
Save a new copy of your file and try again.' + 'detail': ( + 'Notify cannot read this PDF.' + '
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.
' - 'Files must meet our letter specification.' + 'detail': ( + 'You need to add a recipient address.
' + 'Files must meet our letter specification.' + ), } } diff --git a/tests/app/test_utils.py b/tests/app/test_utils.py index 8a62252d4..9c555cd5f 100644 --- a/tests/app/test_utils.py +++ b/tests/app/test_utils.py @@ -426,9 +426,9 @@ def test_get_letter_validation_error_for_unknown_error(): 'Letters must be 10 pages or less.
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)