mirror of
https://github.com/GSA/notifications-api.git
synced 2026-08-16 20:48:37 -04: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:
@@ -262,7 +262,7 @@ def persist_letter(
|
|||||||
handle_exception(self, notification, notification_id, e)
|
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")
|
@statsd(namespace="tasks")
|
||||||
def build_dvla_file(self, job_id):
|
def build_dvla_file(self, job_id):
|
||||||
try:
|
try:
|
||||||
|
|||||||
@@ -29,6 +29,6 @@ notifications-python-client>=3.1,<3.2
|
|||||||
awscli>=1.11,<1.12
|
awscli>=1.11,<1.12
|
||||||
awscli-cwlogs>=1.4,<1.5
|
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
|
git+https://github.com/alphagov/boto.git@2.43.0-patch3#egg=boto==2.43.0-patch3
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import pytest
|
|||||||
from flask import current_app
|
from flask import current_app
|
||||||
from freezegun import freeze_time
|
from freezegun import freeze_time
|
||||||
from sqlalchemy.exc import SQLAlchemyError
|
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 celery.exceptions import Retry
|
||||||
|
|
||||||
from app import (encryption, DATETIME_FORMAT)
|
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',
|
tasks.build_dvla_file.retry.assert_called_with(queue='retry',
|
||||||
exc="All notifications for job {} are not persisted".format(job.id))
|
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',
|
'addressline2': 'A2',
|
||||||
'addressline3': 'A3',
|
'addressline3': 'A3',
|
||||||
'addressline4': 'A4',
|
'addressline4': 'A4',
|
||||||
|
'addressline5': 'A5',
|
||||||
|
'addressline6': 'A6',
|
||||||
'postcode': 'A_POST'
|
'postcode': 'A_POST'
|
||||||
}
|
}
|
||||||
return create_notification(sample_letter_template, personalisation=address)
|
return create_notification(sample_letter_template, personalisation=address)
|
||||||
|
|||||||
Reference in New Issue
Block a user