summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnssi Kääriäinen <akaariai@gmail.com>2013-07-29 14:23:36 +0300
committerAnssi Kääriäinen <akaariai@gmail.com>2013-07-29 14:28:41 +0300
commitbf4c8d8c9810b2c21cfc2fd619fcdf2f5ad5c7fd (patch)
tree14e81ce20a7aaa52da7d02de9d0bd9181e6bb23a
parentb5ac25dc0c1d2d66b70451c551b271b920b85455 (diff)
[1.5.x] Fixed qs ordering related randomly failing test
The failure wasn't present in 1.6+, so this is not a backpatch.
-rw-r--r--tests/regressiontests/aggregation_regress/tests.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/tests/regressiontests/aggregation_regress/tests.py b/tests/regressiontests/aggregation_regress/tests.py
index 9b3cd41e41..71c90ecb5e 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),