Commit 83420e70 authored by Tim Graham's avatar Tim Graham
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 33dd8f54
parent f2a9f715
Loading
Loading
Loading
Loading
+3 −4
Original line number Diff line number Diff line
@@ -587,10 +587,9 @@ class AggregationTests(TestCase):
        )

        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),