Pass date of letter to template preview

Otherwise all letters will show the current date.

Also beefed up the tests around this part of the code a bit.
This commit is contained in:
Chris Hill-Scott
2018-04-30 15:47:49 +01:00
parent 238e85ea9e
commit 8ae800b117
2 changed files with 23 additions and 8 deletions

View File

@@ -247,6 +247,7 @@ def preview_letter_template_by_notification_id(service_id, notification_id, file
'letter_contact_block': notification.reply_to_text,
'template': template_for_letter_print,
'values': notification.personalisation,
'date': notification.created_at.isoformat(),
'dvla_org_id': service.dvla_organisation_id,
}