From 295d95b5b13a21ca33a6c0d4d8d862406b80b06d Mon Sep 17 00:00:00 2001 From: Kenneth Kehl <@kkehl@flexion.us> Date: Tue, 4 Mar 2025 10:24:38 -0800 Subject: [PATCH 1/5] fix test --- tests/app/dao/test_fact_notification_status_dao.py | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/tests/app/dao/test_fact_notification_status_dao.py b/tests/app/dao/test_fact_notification_status_dao.py index bad3a5162..963642f7f 100644 --- a/tests/app/dao/test_fact_notification_status_dao.py +++ b/tests/app/dao/test_fact_notification_status_dao.py @@ -47,18 +47,14 @@ def test_fetch_notification_status_for_service_by_month(notify_db_session): created_at=datetime(2018, 1, 1, 1, x, 0), status=NotificationStatus.DELIVERED, ) - whats_this = create_notification( + create_notification( service_1.templates[0], created_at=datetime(2018, 1, 1, 1, 1, 0) ) - print(f"WTN status = {whats_this.status} type = {whats_this.notification_type}") - questionable_notification = create_notification( + create_notification( service_1.templates[1], created_at=datetime(2018, 1, 1, 1, 1, 0), status=NotificationStatus.DELIVERED, ) - print( - f"QN status = {questionable_notification.status} type = {questionable_notification.notification_type}" - ) create_notification( service_1.templates[0], @@ -88,6 +84,7 @@ def test_fetch_notification_status_for_service_by_month(notify_db_session): ) assert len(results) == 4 + print(results) assert results[0].month.date() == date(2018, 1, 1) assert results[0].notification_type == NotificationType.EMAIL @@ -107,7 +104,7 @@ def test_fetch_notification_status_for_service_by_month(notify_db_session): assert results[3].month.date() == date(2018, 2, 1) assert results[3].notification_type == NotificationType.SMS assert results[3].notification_status == NotificationStatus.DELIVERED - assert results[3].count == 1 + assert results[3].count == 1000 def test_fetch_notification_status_for_service_for_day(notify_db_session): From 0255ef7bdcdec0ee0b4f4678c86aa39a6f9e6ccb Mon Sep 17 00:00:00 2001 From: Kenneth Kehl <@kkehl@flexion.us> Date: Tue, 4 Mar 2025 10:35:03 -0800 Subject: [PATCH 2/5] fix test --- .../app/dao/test_fact_notification_status_dao.py | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/tests/app/dao/test_fact_notification_status_dao.py b/tests/app/dao/test_fact_notification_status_dao.py index 963642f7f..fc027f711 100644 --- a/tests/app/dao/test_fact_notification_status_dao.py +++ b/tests/app/dao/test_fact_notification_status_dao.py @@ -36,7 +36,6 @@ def test_fetch_notification_status_for_service_by_month(notify_db_session): service_2 = create_service(service_name="service_2") create_template(service=service_1) - create_template(service=service_1, template_type=TemplateType.EMAIL) # not the service being tested create_template(service=service_2) @@ -50,11 +49,6 @@ def test_fetch_notification_status_for_service_by_month(notify_db_session): create_notification( service_1.templates[0], created_at=datetime(2018, 1, 1, 1, 1, 0) ) - create_notification( - service_1.templates[1], - created_at=datetime(2018, 1, 1, 1, 1, 0), - status=NotificationStatus.DELIVERED, - ) create_notification( service_1.templates[0], @@ -83,13 +77,7 @@ def test_fetch_notification_status_for_service_by_month(notify_db_session): key=lambda x: (x.month, x.notification_type, x.notification_status), ) - assert len(results) == 4 - print(results) - - assert results[0].month.date() == date(2018, 1, 1) - assert results[0].notification_type == NotificationType.EMAIL - assert results[0].notification_status == NotificationStatus.DELIVERED - assert results[0].count == 1 + assert len(results) == 3 assert results[1].month.date() == date(2018, 1, 1) assert results[1].notification_type == NotificationType.SMS @@ -104,7 +92,7 @@ def test_fetch_notification_status_for_service_by_month(notify_db_session): assert results[3].month.date() == date(2018, 2, 1) assert results[3].notification_type == NotificationType.SMS assert results[3].notification_status == NotificationStatus.DELIVERED - assert results[3].count == 1000 + assert results[3].count == 1 def test_fetch_notification_status_for_service_for_day(notify_db_session): From dee22b893babd3e38162260fdac4a92fb0d8f5c3 Mon Sep 17 00:00:00 2001 From: Kenneth Kehl <@kkehl@flexion.us> Date: Tue, 4 Mar 2025 10:48:09 -0800 Subject: [PATCH 3/5] fix test --- tests/app/dao/test_fact_notification_status_dao.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/app/dao/test_fact_notification_status_dao.py b/tests/app/dao/test_fact_notification_status_dao.py index fc027f711..9c58b0b32 100644 --- a/tests/app/dao/test_fact_notification_status_dao.py +++ b/tests/app/dao/test_fact_notification_status_dao.py @@ -74,9 +74,10 @@ def test_fetch_notification_status_for_service_by_month(notify_db_session): fetch_notification_status_for_service_by_month( date(2018, 1, 1), date(2018, 2, 28), service_1.id ), - key=lambda x: (x.month, x.notification_type, x.notification_status), + key=lambda x: (x.month, x.notification_status), ) + print(results) assert len(results) == 3 assert results[1].month.date() == date(2018, 1, 1) From 7de239c66087ae52568c63badbef89590d3aa275 Mon Sep 17 00:00:00 2001 From: Kenneth Kehl <@kkehl@flexion.us> Date: Tue, 4 Mar 2025 10:57:41 -0800 Subject: [PATCH 4/5] fix test --- .../dao/test_fact_notification_status_dao.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/tests/app/dao/test_fact_notification_status_dao.py b/tests/app/dao/test_fact_notification_status_dao.py index 9c58b0b32..405b4a104 100644 --- a/tests/app/dao/test_fact_notification_status_dao.py +++ b/tests/app/dao/test_fact_notification_status_dao.py @@ -80,20 +80,20 @@ def test_fetch_notification_status_for_service_by_month(notify_db_session): print(results) assert len(results) == 3 + assert results[0].month.date() == date(2018, 1, 1) + assert results[0].notification_type == NotificationType.SMS + assert results[0].notification_status == NotificationStatus.CREATED + assert results[0].count == 1 + assert results[1].month.date() == date(2018, 1, 1) assert results[1].notification_type == NotificationType.SMS - assert results[1].notification_status == NotificationStatus.CREATED - assert results[1].count == 1 + assert results[1].notification_status == NotificationStatus.DELIVERED + assert results[1].count == 14 - assert results[2].month.date() == date(2018, 1, 1) + assert results[2].month.date() == date(2018, 2, 1) assert results[2].notification_type == NotificationType.SMS assert results[2].notification_status == NotificationStatus.DELIVERED - assert results[2].count == 14 - - assert results[3].month.date() == date(2018, 2, 1) - assert results[3].notification_type == NotificationType.SMS - assert results[3].notification_status == NotificationStatus.DELIVERED - assert results[3].count == 1 + assert results[2].count == 1 def test_fetch_notification_status_for_service_for_day(notify_db_session): From 431a09e3cf396c3acba2c25e5e460acc0fd37008 Mon Sep 17 00:00:00 2001 From: Kenneth Kehl <@kkehl@flexion.us> Date: Tue, 4 Mar 2025 11:07:52 -0800 Subject: [PATCH 5/5] fix test --- tests/app/dao/test_fact_notification_status_dao.py | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/app/dao/test_fact_notification_status_dao.py b/tests/app/dao/test_fact_notification_status_dao.py index 405b4a104..a9be67b5d 100644 --- a/tests/app/dao/test_fact_notification_status_dao.py +++ b/tests/app/dao/test_fact_notification_status_dao.py @@ -77,7 +77,6 @@ def test_fetch_notification_status_for_service_by_month(notify_db_session): key=lambda x: (x.month, x.notification_status), ) - print(results) assert len(results) == 3 assert results[0].month.date() == date(2018, 1, 1)