mirror of https://github.com/django/django.git
[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"))
|
||||
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),
|
||||
|
|
Loading…
Reference in New Issue