diff --git a/app/celery/tasks.py b/app/celery/tasks.py index ff74c98bb..cebcb8862 100644 --- a/app/celery/tasks.py +++ b/app/celery/tasks.py @@ -161,7 +161,7 @@ def send_sms(self, service_id, notification_id, encrypted_notification, created_ ) dao_create_notification(notification_db_object, TEMPLATE_TYPE_SMS) - send_sms_to_provider.apply_async((service_id, notification_id, encrypted_notification), queue='sms') + send_sms_to_provider.apply_async((service_id, notification_id), queue='sms') current_app.logger.info( "SMS {} created at {} sent at {}".format(notification_id, created_at, sent_at) diff --git a/tests/app/celery/test_provider_tasks.py b/tests/app/celery/test_provider_tasks.py index 45524a130..e0fff90f6 100644 --- a/tests/app/celery/test_provider_tasks.py +++ b/tests/app/celery/test_provider_tasks.py @@ -1,20 +1,18 @@ +from datetime import datetime + from celery.exceptions import MaxRetriesExceededError - from mock import ANY, call +from notifications_utils.recipients import validate_phone_number, format_phone_number -from app import statsd_client, mmg_client, encryption +from app import statsd_client, mmg_client from app.celery import provider_tasks from app.celery.provider_tasks import send_sms_to_provider +from app.celery.research_mode_tasks import send_sms_response from app.celery.tasks import provider_to_use from app.clients.sms import SmsClientException -from app.dao import provider_statistics_dao -from datetime import datetime -from freezegun import freeze_time from app.dao import notifications_dao, provider_details_dao -from notifications_utils.recipients import validate_phone_number, format_phone_number -from app.celery.research_mode_tasks import send_sms_response +from app.dao import provider_statistics_dao from app.models import Notification, NotificationStatistics, Job - from tests.app.conftest import ( sample_notification ) diff --git a/tests/app/celery/test_tasks.py b/tests/app/celery/test_tasks.py index 39452a2de..34e07ba31 100644 --- a/tests/app/celery/test_tasks.py +++ b/tests/app/celery/test_tasks.py @@ -332,8 +332,7 @@ def test_should_send_template_to_correct_sms_task_and_persist(sample_template_wi provider_tasks.send_sms_to_provider.apply_async.assert_called_once_with( (sample_template_with_placeholders.service_id, - notification_id, - encryption.encrypt(notification)), + notification_id), queue="sms" ) @@ -371,8 +370,7 @@ def test_should_send_sms_if_restricted_service_and_valid_number(notify_db, notif provider_tasks.send_sms_to_provider.apply_async.assert_called_once_with( (service.id, - notification_id, - encrypt_notification), + notification_id), queue="sms" ) @@ -480,8 +478,7 @@ def test_should_send_sms_template_to_and_persist_with_job_id(sample_job, mocker) ) provider_tasks.send_sms_to_provider.apply_async.assert_called_once_with( (sample_job.service.id, - notification_id, - encryption.encrypt(notification)), + notification_id), queue="sms" ) persisted_notification = Notification.query.filter_by(id=notification_id).one()