summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRussell Keith-Magee <russell@keith-magee.com>2011-01-17 02:40:16 +0000
committerRussell Keith-Magee <russell@keith-magee.com>2011-01-17 02:40:16 +0000
commitaeddab3fc7c92befa491a95f97eff2830ae96841 (patch)
treecc72792b52326574040aea4eae3ce0c81ede2d45
parent0866dc171582125bb9d81a640a70d907553e9d54 (diff)
[1.2.X] Corrected an aggregation test failure under PostgreSQL, introduced by r15223. Thanks to Alex for the report.
Backport of r15230 from trunk. git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.2.X@15231 bcc190cf-cafb-0310-a4f2-bffc1f526a37
-rw-r--r--tests/regressiontests/aggregation_regress/tests.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/regressiontests/aggregation_regress/tests.py b/tests/regressiontests/aggregation_regress/tests.py
index 821412e409..822785b7a5 100644
--- a/tests/regressiontests/aggregation_regress/tests.py
+++ b/tests/regressiontests/aggregation_regress/tests.py
@@ -500,19 +500,19 @@ class AggregationTests(TestCase):
# age is a field on Author, so it shouldn't be allowed as an aggregate.
# But age isn't included in the ValuesQuerySet, so it is.
- results = Author.objects.values('name').annotate(age=Count('book_contact_set'))
+ results = Author.objects.values('name').annotate(age=Count('book_contact_set')).order_by('name')
self.assertEquals(len(results), 9)
self.assertEquals(results[0]['name'], u'Adrian Holovaty')
self.assertEquals(results[0]['age'], 1)
# Same problem, but aggregating over m2m fields
- results = Author.objects.values('name').annotate(age=Avg('friends__age'))
+ results = Author.objects.values('name').annotate(age=Avg('friends__age')).order_by('name')
self.assertEquals(len(results), 9)
self.assertEquals(results[0]['name'], u'Adrian Holovaty')
self.assertEquals(results[0]['age'], 32.0)
# Same problem, but colliding with an m2m field
- results = Author.objects.values('name').annotate(friends=Count('friends'))
+ results = Author.objects.values('name').annotate(friends=Count('friends')).order_by('name')
self.assertEquals(len(results), 9)
self.assertEquals(results[0]['name'], u'Adrian Holovaty')
self.assertEquals(results[0]['friends'], 2)