Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

[1.4.x] Fixed random aggregation_regress test_more_more_more() failure

The cause was assuming that an unordered queryset returns the values
always in the same order.

Backport of 33dd8f5
  • Loading branch information...
commit 83420e70ef98c015207f8a49bd35ebb098ac6df5 1 parent f2a9f71
@timgraham timgraham authored
Showing with 3 additions and 4 deletions.
  1. +3 −4 tests/regressiontests/aggregation_regress/tests.py
View
7 tests/regressiontests/aggregation_regress/tests.py
@@ -587,10 +587,9 @@ def test_more_more_more(self):
)
publishers = publishers.annotate(n_books=Count("book"))
- self.assertEqual(
- publishers[0].n_books,
- 2
- )
+ sorted_publishers = sorted(publishers, key=lambda x: x.name)
+ self.assertEqual(sorted_publishers[0].n_books, 2)
+ self.assertEqual(sorted_publishers[1].n_books, 1)
self.assertEqual(
sorted(p.name for p in publishers),
Please sign in to comment.
Something went wrong with that request. Please try again.