mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-01 07:35:34 -05:00
Update the version of notifications-utils.
There was a problem with the address block for the DVLATemplate. Added a countdown to the build_dvla_file.
This commit is contained in:
@@ -6,7 +6,7 @@ import pytest
|
||||
from flask import current_app
|
||||
from freezegun import freeze_time
|
||||
from sqlalchemy.exc import SQLAlchemyError
|
||||
from notifications_utils.template import SMSMessageTemplate, WithSubjectTemplate
|
||||
from notifications_utils.template import SMSMessageTemplate, WithSubjectTemplate, LetterDVLATemplate
|
||||
from celery.exceptions import Retry
|
||||
|
||||
from app import (encryption, DATETIME_FORMAT)
|
||||
@@ -996,3 +996,13 @@ def test_build_dvla_file_retries_if_all_notifications_are_not_created(sample_let
|
||||
|
||||
tasks.build_dvla_file.retry.assert_called_with(queue='retry',
|
||||
exc="All notifications for job {} are not persisted".format(job.id))
|
||||
|
||||
|
||||
@freeze_time("2017-03-23 11:09:00.061258")
|
||||
def test_dvla_letter_template(sample_letter_notification):
|
||||
t = {"content": sample_letter_notification.template.content,
|
||||
"subject": sample_letter_notification.template.subject}
|
||||
letter = LetterDVLATemplate(t,
|
||||
sample_letter_notification.personalisation,
|
||||
12345)
|
||||
assert str(letter) == "140|001|001||201703230012345|23032017||||||||||||A1|A2|A3|A4|A5|A6||A_POST||||||||Template subject|Dear Sir/Madam, Hello. Yours Truly, The Government.<cr><cr>" # noqa
|
||||
|
||||
@@ -495,6 +495,8 @@ def sample_letter_notification(sample_letter_template):
|
||||
'addressline2': 'A2',
|
||||
'addressline3': 'A3',
|
||||
'addressline4': 'A4',
|
||||
'addressline5': 'A5',
|
||||
'addressline6': 'A6',
|
||||
'postcode': 'A_POST'
|
||||
}
|
||||
return create_notification(sample_letter_template, personalisation=address)
|
||||
|
||||
Reference in New Issue
Block a user