From bf4c8d8c9810b2c21cfc2fd619fcdf2f5ad5c7fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anssi=20K=C3=A4=C3=A4ri=C3=A4inen?= Date: Mon, 29 Jul 2013 14:23:36 +0300 Subject: [PATCH] [1.5.x] Fixed qs ordering related randomly failing test The failure wasn't present in 1.6+, so this is not a backpatch. --- tests/regressiontests/aggregation_regress/tests.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/regressiontests/aggregation_regress/tests.py b/tests/regressiontests/aggregation_regress/tests.py index 9b3cd41e41e..71c90ecb5ef 100644 --- a/tests/regressiontests/aggregation_regress/tests.py +++ b/tests/regressiontests/aggregation_regress/tests.py @@ -588,10 +588,15 @@ class AggregationTests(TestCase): ) publishers = publishers.annotate(n_books=Count("book")) + sorted_publishers = sorted(publishers, key=lambda x: x.name) self.assertEqual( - publishers[0].n_books, + sorted_publishers[0].n_books, 2 ) + self.assertEqual( + sorted_publishers[1].n_books, + 1 + ) self.assertEqual( sorted(p.name for p in publishers),