From 10ceb0467eabed03c2b6bf53bb09aeb981940d0f Mon Sep 17 00:00:00 2001 From: Leo Hemsted Date: Fri, 8 Sep 2017 16:36:55 +0100 Subject: [PATCH] fix ordering to prevent random test failures --- tests/app/dao/test_monthly_billing.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/app/dao/test_monthly_billing.py b/tests/app/dao/test_monthly_billing.py index 23c445f92..e5813c9bf 100644 --- a/tests/app/dao/test_monthly_billing.py +++ b/tests/app/dao/test_monthly_billing.py @@ -198,7 +198,10 @@ def test_add_monthly_billing_for_multiple_months_populate_correctly( create_or_update_monthly_billing(service_id=sample_template.service_id, billing_month=FEB_2016_MONTH_START) create_or_update_monthly_billing(service_id=sample_template.service_id, billing_month=MAR_2016_MONTH_START) - monthly_billing = MonthlyBilling.query.order_by(MonthlyBilling.notification_type).all() + monthly_billing = MonthlyBilling.query.order_by( + MonthlyBilling.notification_type, + MonthlyBilling.start_date + ).all() assert len(monthly_billing) == 4 _assert_monthly_billing(