From 7ef6af2d1466ac6f768831419936dd098a67edf1 Mon Sep 17 00:00:00 2001 From: Chris Hill-Scott Date: Fri, 2 Mar 2018 14:12:38 +0000 Subject: [PATCH] Remove anything to do with DVLA format letters --- app/models.py | 5 ++--- requirements.txt | 2 +- tests/app/celery/test_tasks.py | 10 +--------- 3 files changed, 4 insertions(+), 13 deletions(-) diff --git a/app/models.py b/app/models.py index 6678d91e6..bd23dc65c 100644 --- a/app/models.py +++ b/app/models.py @@ -23,7 +23,7 @@ from notifications_utils.letter_timings import get_letter_timings from notifications_utils.template import ( PlainTextEmailTemplate, SMSMessageTemplate, - LetterDVLATemplate, + LetterPrintTemplate, ) from app.encryption import ( @@ -728,9 +728,8 @@ class TemplateBase(db.Model): {'content': self.content} ) if self.template_type == LETTER_TYPE: - return LetterDVLATemplate( + return LetterPrintTemplate( {'content': self.content, 'subject': self.subject}, - notification_reference=1, contact_block=self.service.get_default_letter_contact(), ) diff --git a/requirements.txt b/requirements.txt index 7868b54fa..96ed83f1e 100644 --- a/requirements.txt +++ b/requirements.txt @@ -23,6 +23,6 @@ notifications-python-client==4.7.2 # PaaS awscli-cwlogs>=1.4,<1.5 -git+https://github.com/alphagov/notifications-utils.git@23.8.0#egg=notifications-utils==23.8.0 +git+https://github.com/alphagov/notifications-utils.git@24.0.0#egg=notifications-utils==24.0.0 git+https://github.com/alphagov/boto.git@2.43.0-patch3#egg=boto==2.43.0-patch3 diff --git a/tests/app/celery/test_tasks.py b/tests/app/celery/test_tasks.py index 0ff66a4f7..f8e00651f 100644 --- a/tests/app/celery/test_tasks.py +++ b/tests/app/celery/test_tasks.py @@ -9,7 +9,7 @@ from freezegun import freeze_time from requests import RequestException from sqlalchemy.exc import SQLAlchemyError from celery.exceptions import Retry -from notifications_utils.template import SMSMessageTemplate, WithSubjectTemplate, LetterDVLATemplate +from notifications_utils.template import SMSMessageTemplate, WithSubjectTemplate from app import (encryption, DATETIME_FORMAT) from app.celery import provider_tasks @@ -1209,14 +1209,6 @@ def test_get_template_class(template_type, expected_class): assert get_template_class(template_type) == expected_class -@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, "random-string") - assert str(letter) == "140|500|001||random-string|||||||||||||A1||A2|A3|A4|A5|A6|A_POST|||||||||23 March 2017

Template subjectDear Sir/Madam, Hello. Yours Truly, The Government." # noqa - - def test_send_inbound_sms_to_service_post_https_request_to_service(notify_api, sample_service): inbound_api = create_service_inbound_api(service=sample_service, url="https://some.service.gov.uk/", bearer_token="something_unique")