From 17b6c13c46021661966a9ea2b91441b049f5468a Mon Sep 17 00:00:00 2001 From: Imdad Ahad Date: Mon, 27 Feb 2017 13:16:48 +0000 Subject: [PATCH] Small updates: * Make config use new provider sms template id * create_notification to account for created status * Small robustness addition to test --- app/config.py | 2 +- tests/app/dao/test_notification_dao.py | 2 +- tests/app/db.py | 8 +++----- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/app/config.py b/app/config.py index 13b4c9063..07c1c419e 100644 --- a/app/config.py +++ b/app/config.py @@ -240,7 +240,7 @@ class Live(Config): STATSD_ENABLED = True FROM_NUMBER = '40604' FUNCTIONAL_TEST_PROVIDER_SERVICE_ID = '6c1d81bb-dae2-4ee9-80b0-89a4aae9f649' - FUNCTIONAL_TEST_PROVIDER_SMS_TEMPLATE_ID = '285bb62d-08e7-414b-b5a3-6372ba320e06' + FUNCTIONAL_TEST_PROVIDER_SMS_TEMPLATE_ID = 'ba9e1789-a804-40b8-871f-cc60d4c1286f' class CloudFoundryConfig(Config): diff --git a/tests/app/dao/test_notification_dao.py b/tests/app/dao/test_notification_dao.py index bdcef6dcd..7081c3c1b 100644 --- a/tests/app/dao/test_notification_dao.py +++ b/tests/app/dao/test_notification_dao.py @@ -1514,7 +1514,7 @@ def test_slow_provider_delivery_returns_for_delivered_notifications_only( slow_delivery = is_delivery_slow_for_provider( sent_at=now, provider='firetext', - threshold=1, + threshold=2, delivery_time=timedelta(minutes=5), service_id=sample_template.service.id, template_id=sample_template.id diff --git a/tests/app/db.py b/tests/app/db.py index 4b0e9185c..093bd828e 100644 --- a/tests/app/db.py +++ b/tests/app/db.py @@ -75,11 +75,9 @@ def create_notification( if created_at is None: created_at = datetime.utcnow() - if sent_at is None: - sent_at = datetime.utcnow() - - if updated_at is None: - updated_at = datetime.utcnow() + if status != 'created': + sent_at = sent_at or datetime.utcnow() + updated_at = updated_at or datetime.utcnow() data = { 'id': uuid.uuid4(),