From 7743bdd43c112913f2056cbdc31ea3c0e8007f22 Mon Sep 17 00:00:00 2001 From: Kenneth Kehl <@kkehl@flexion.us> Date: Wed, 2 Jul 2025 07:45:22 -0700 Subject: [PATCH] more tests --- tests/app/dao/test_services_dao.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tests/app/dao/test_services_dao.py b/tests/app/dao/test_services_dao.py index f65151649..84c401fd2 100644 --- a/tests/app/dao/test_services_dao.py +++ b/tests/app/dao/test_services_dao.py @@ -1852,11 +1852,13 @@ def test_dao_fetch_stats_for_service_from_hours(mock_execute, mock_get_midnight) return datetime(dt.year, dt.month, dt.day) mock_get_midnight.side_effect = _mock_midnight - total_result = [ + total_result_mock = MagicMock() + total_result_mock.all.return_value = [ MagicMock(hour=datetime(2025, 7, 1, 16), total_notifications=100), MagicMock(hour=datetime(2025, 7, 1, 17), total_notifications=50), ] - detail_result = [ + detail_result_mock = MagicMock() + detail_result_mock.all.return_value = [ MagicMock( notification_type="email", status="delivered", @@ -1870,7 +1872,7 @@ def test_dao_fetch_stats_for_service_from_hours(mock_execute, mock_get_midnight) count=20, ), ] - mock_execute.side_effect = [total_result, detail_result] + mock_execute.side_effect = [total_result_mock, detail_result_mock] total_notifications, data = dao_fetch_stats_for_service_from_hours( service_id, start, end )