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:
Rebecca Law
2017-03-24 15:25:02 +00:00
parent 5fcc80c7be
commit 37a5ce601a
4 changed files with 15 additions and 3 deletions

View File

@@ -262,7 +262,7 @@ def persist_letter(
handle_exception(self, notification, notification_id, e)
@notify_celery.task(bind=True, name="build-dvla-file", max_retries=15, default_retry_delay=300)
@notify_celery.task(bind=True, name="build-dvla-file", countdown=30, max_retries=15, default_retry_delay=300)
@statsd(namespace="tasks")
def build_dvla_file(self, job_id):
try:

View File

@@ -29,6 +29,6 @@ notifications-python-client>=3.1,<3.2
awscli>=1.11,<1.12
awscli-cwlogs>=1.4,<1.5
git+https://github.com/alphagov/notifications-utils.git@13.8.0#egg=notifications-utils==13.8.0
git+https://github.com/alphagov/notifications-utils.git@13.9.5#egg=notifications-utils==13.9.5
git+https://github.com/alphagov/boto.git@2.43.0-patch3#egg=boto==2.43.0-patch3

View File

@@ -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

View File

@@ -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)