[1.2.X] Fixed a test that was failing in Oracle due to default ordering assumptions.
Backport of r15783 from trunk. git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.2.X@15784 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
1c08ca568f
commit
4c152afbb6
|
@ -589,12 +589,12 @@ class AggregationTests(TestCase):
|
||||||
)
|
)
|
||||||
|
|
||||||
publishers = Publisher.objects.filter(id__in=[1, 2])
|
publishers = Publisher.objects.filter(id__in=[1, 2])
|
||||||
self.assertQuerysetEqual(
|
self.assertEqual(
|
||||||
publishers, [
|
sorted(p.name for p in publishers),
|
||||||
|
[
|
||||||
"Apress",
|
"Apress",
|
||||||
"Sams"
|
"Sams"
|
||||||
],
|
]
|
||||||
lambda p: p.name
|
|
||||||
)
|
)
|
||||||
|
|
||||||
publishers = publishers.annotate(n_books=Count("book"))
|
publishers = publishers.annotate(n_books=Count("book"))
|
||||||
|
@ -603,12 +603,12 @@ class AggregationTests(TestCase):
|
||||||
2
|
2
|
||||||
)
|
)
|
||||||
|
|
||||||
self.assertQuerysetEqual(
|
self.assertEqual(
|
||||||
publishers, [
|
sorted(p.name for p in publishers),
|
||||||
|
[
|
||||||
"Apress",
|
"Apress",
|
||||||
"Sams",
|
"Sams"
|
||||||
],
|
]
|
||||||
lambda p: p.name
|
|
||||||
)
|
)
|
||||||
|
|
||||||
books = Book.objects.filter(publisher__in=publishers)
|
books = Book.objects.filter(publisher__in=publishers)
|
||||||
|
@ -620,12 +620,12 @@ class AggregationTests(TestCase):
|
||||||
],
|
],
|
||||||
lambda b: b.name
|
lambda b: b.name
|
||||||
)
|
)
|
||||||
self.assertQuerysetEqual(
|
self.assertEqual(
|
||||||
publishers, [
|
sorted(p.name for p in publishers),
|
||||||
|
[
|
||||||
"Apress",
|
"Apress",
|
||||||
"Sams",
|
"Sams"
|
||||||
],
|
]
|
||||||
lambda p: p.name
|
|
||||||
)
|
)
|
||||||
|
|
||||||
# Regression for 10666 - inherited fields work with annotations and
|
# Regression for 10666 - inherited fields work with annotations and
|
||||||
|
|
Loading…
Reference in New Issue