Test that addresses display on uploads page

We didn’t have a test that checked for the first two lines of the
address being displayed when rendering one-off letters on the uploads
page.

I double checked in the database and we store addresses in the `to`
field with newlines, not commas.
This commit is contained in:
Chris Hill-Scott
2020-03-03 10:50:07 +00:00
parent b1a97b0d69
commit 7a780d115e
2 changed files with 26 additions and 7 deletions

View File

@@ -62,7 +62,7 @@
) }}
{% elif item.pdf_letter %}
<p class="govuk-body govuk-!-margin-bottom-1">
{% for line in item.recipient.split(',') %}
{% for line in item.recipient.splitlines() %}
{% if loop.index < 3 %}
{{ line }}<br>
{% endif %}