input letter address data in a single block

rather than in multiple placeholders - this is the first step towards
making postcodes non-required, which is the first step towards
international letters.

they still populate address_line_# and postcode fields under the hood -
to keep validation working the same, the last line always goes into
`postcode`.

the form normalises whitespace, removes extra new lines, and enforces
that you have between three and seven lines.

if the letter repeats address placeholders further down (eg "Dear
((address_line_1))"), then it'll fill those in as well. It'll still
prompt you to fill them in, but they'll be pre-filled.
This commit is contained in:
Leo Hemsted
2020-03-10 15:12:19 +00:00
parent df51bf6f5f
commit c4d839d4f5
7 changed files with 411 additions and 13 deletions

View File

@@ -3483,6 +3483,19 @@ def mock_get_returned_letter_summary_with_no_returned_letters(mocker):
)
@pytest.fixture
def mock_template_preview(mocker):
content = b'{"count":1}'
status_code = 200
headers = {}
example_response = (content, status_code, headers)
mocker.patch('app.template_previews.TemplatePreview.from_database_object', return_value=example_response)
mocker.patch('app.template_previews.TemplatePreview.from_valid_pdf_file', return_value=example_response)
mocker.patch('app.template_previews.TemplatePreview.from_invalid_pdf_file', return_value=example_response)
mocker.patch('app.template_previews.TemplatePreview.from_example_template', return_value=example_response)
mocker.patch('app.template_previews.TemplatePreview.from_utils_template', return_value=example_response)
def create_api_user_active(with_unique_id=False):
return {
'id': str(uuid4()) if with_unique_id else sample_uuid(),