1
0
mirror of https://github.com/django/django.git synced 2025-04-22 00:04:43 +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:
Anssi Kääriäinen 2013-07-29 14:23:36 +03:00
parent b5ac25dc0c
commit bf4c8d8c98

View File

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