Pulled out the tests that send SMSs into provider_tasks file/tests

- updated tests to validate creation of next task, not sending direct to provider
This commit is contained in:
Martyn Inglis
2016-06-07 12:53:31 +01:00
parent 37fe2342ae
commit 92e4c0872b
5 changed files with 199 additions and 223 deletions

View File

@@ -3,6 +3,7 @@ from datetime import datetime
from flask import current_app
from monotonic import monotonic
from sqlalchemy.exc import SQLAlchemyError
from app import clients, statsd_client
from app.clients.email import EmailClientException
@@ -10,7 +11,7 @@ from app.clients.sms import SmsClientException
from app.dao.services_dao import dao_fetch_service_by_id
from app.dao.templates_dao import dao_get_template_by_id
from app.dao.provider_details_dao import get_provider_details_by_notification_type
from app.celery.research_mode_tasks import send_email_response, send_sms_response
from app.celery.research_mode_tasks import send_email_response
from app.celery.provider_tasks import (
send_sms_to_provider
)
@@ -285,7 +286,7 @@ def send_email(service_id, notification_id, from_address, encrypted_notification
sent_by=provider.get_name()
)
dao_create_notification(notification_db_object, TEMPLATE_TYPE_EMAIL, provider.get_name())
dao_create_notification(notification_db_object, TEMPLATE_TYPE_EMAIL)
statsd_client.timing_with_dates(
"notifications.tasks.send-email.queued-for",
sent_at,