mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-03 01:41:05 -05:00
Stop sending the encrypted message to the send_sms_to_provider task.
Everything the task needs is now stored in the db.
This commit is contained in:
@@ -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
|
||||
)
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user