diff --git a/app/service/send_notification.py b/app/service/send_notification.py index 068331167..5274d5e2b 100644 --- a/app/service/send_notification.py +++ b/app/service/send_notification.py @@ -4,7 +4,8 @@ from app.dao.service_sms_sender_dao import dao_get_service_sms_senders_by_id from app.notifications.validators import ( check_service_over_daily_message_limit, validate_and_format_recipient, - validate_template, check_service_sms_sender_id) + validate_template +) from app.notifications.process_notifications import ( persist_notification, send_notification_to_queue, @@ -15,7 +16,9 @@ from app.models import ( KEY_TYPE_NORMAL, PRIORITY, SMS_TYPE, - EMAIL_TYPE, LETTER_TYPE) + EMAIL_TYPE, + LETTER_TYPE +) from app.dao.services_dao import dao_fetch_service_by_id from app.dao.templates_dao import dao_get_template_by_id_and_service_id from app.dao.users_dao import get_user_by_id diff --git a/tests/app/celery/test_tasks.py b/tests/app/celery/test_tasks.py index 444469731..df1bf92f4 100644 --- a/tests/app/celery/test_tasks.py +++ b/tests/app/celery/test_tasks.py @@ -991,7 +991,7 @@ def test_save_sms_does_not_send_duplicate_and_does_not_put_in_retry_queue(sample def test_save_letter_saves_letter_to_database(mocker, notify_db_session): service = create_service() - create_letter_contact(service=service, contact_block="Address contract", is_default=True) + create_letter_contact(service=service, contact_block="Address contact", is_default=True) template = create_template(service=service, template_type=LETTER_TYPE) job = create_job(template=template) @@ -1035,7 +1035,7 @@ def test_save_letter_saves_letter_to_database(mocker, notify_db_session): assert notification_db.sent_by is None assert notification_db.personalisation == personalisation assert notification_db.reference == "this-is-random-in-real-life" - assert notification_db.reply_to_text == "Address contract" + assert notification_db.reply_to_text == "Address contact" def test_should_cancel_job_if_service_is_inactive(sample_service, diff --git a/tests/app/conftest.py b/tests/app/conftest.py index 611baf810..79a56ed10 100644 --- a/tests/app/conftest.py +++ b/tests/app/conftest.py @@ -27,9 +27,17 @@ from app.models import ( ProviderRates, ScheduledNotification, ServiceWhitelist, - KEY_TYPE_NORMAL, KEY_TYPE_TEST, KEY_TYPE_TEAM, - MOBILE_TYPE, EMAIL_TYPE, INBOUND_SMS_TYPE, SMS_TYPE, LETTER_TYPE, NOTIFICATION_STATUS_TYPES_COMPLETED, - SERVICE_PERMISSION_TYPES, ServiceEmailReplyTo + KEY_TYPE_NORMAL, + KEY_TYPE_TEST, + KEY_TYPE_TEAM, + MOBILE_TYPE, + EMAIL_TYPE, + INBOUND_SMS_TYPE, + SMS_TYPE, + LETTER_TYPE, + NOTIFICATION_STATUS_TYPES_COMPLETED, + SERVICE_PERMISSION_TYPES, + ServiceEmailReplyTo ) from app.dao.users_dao import (create_user_code, create_secret_code) from app.dao.services_dao import (dao_create_service, dao_add_user_to_service)