From b0540098addf1bffdad62c0500a8d06ae5398f16 Mon Sep 17 00:00:00 2001 From: Katie Smith Date: Tue, 3 Jul 2018 08:47:43 +0100 Subject: [PATCH] Fix randomly failing test The results of the DAO function do not always get returned in the same order, so this test was occasionally failing. --- .../app/dao/notification_dao/test_notification_dao.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/app/dao/notification_dao/test_notification_dao.py b/tests/app/dao/notification_dao/test_notification_dao.py index 6c348b976..0980f021b 100644 --- a/tests/app/dao/notification_dao/test_notification_dao.py +++ b/tests/app/dao/notification_dao/test_notification_dao.py @@ -1966,11 +1966,11 @@ def test_fetch_aggregate_stats_by_date_range_for_all_services_groups_stats( result = fetch_aggregate_stats_by_date_range_for_all_services(today, today) assert len(result) == 5 - assert result[0] == ('email', 'permanent-failure', 'normal', 3) - assert result[1] == ('email', 'sent', 'normal', 1) - assert result[2] == ('sms', 'sent', 'normal', 1) - assert result[3] == ('sms', 'sent', 'team', 1) - assert result[4] == ('letter', 'virus-scan-failed', 'normal', 1) + assert ('email', 'permanent-failure', 'normal', 3) in result + assert ('email', 'sent', 'normal', 1) in result + assert ('sms', 'sent', 'normal', 1) in result + assert ('sms', 'sent', 'team', 1) in result + assert ('letter', 'virus-scan-failed', 'normal', 1) in result def test_fetch_aggregate_stats_by_date_range_for_all_services_uses_bst_date(sample_template):