mirror of
https://github.com/django/django.git
synced 2025-06-05 03:29:12 +00:00
[1.5.x] Fixed qs ordering related randomly failing test
The failure wasn't present in 1.6+, so this is not a backpatch.
This commit is contained in:
parent
b5ac25dc0c
commit
bf4c8d8c98
@ -588,10 +588,15 @@ class AggregationTests(TestCase):
|
|||||||
)
|
)
|
||||||
|
|
||||||
publishers = publishers.annotate(n_books=Count("book"))
|
publishers = publishers.annotate(n_books=Count("book"))
|
||||||
|
sorted_publishers = sorted(publishers, key=lambda x: x.name)
|
||||||
self.assertEqual(
|
self.assertEqual(
|
||||||
publishers[0].n_books,
|
sorted_publishers[0].n_books,
|
||||||
2
|
2
|
||||||
)
|
)
|
||||||
|
self.assertEqual(
|
||||||
|
sorted_publishers[1].n_books,
|
||||||
|
1
|
||||||
|
)
|
||||||
|
|
||||||
self.assertEqual(
|
self.assertEqual(
|
||||||
sorted(p.name for p in publishers),
|
sorted(p.name for p in publishers),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user