diff options
| author | Russell Keith-Magee <russell@keith-magee.com> | 2011-01-17 02:37:40 +0000 |
|---|---|---|
| committer | Russell Keith-Magee <russell@keith-magee.com> | 2011-01-17 02:37:40 +0000 |
| commit | 964cf1be866e7db410d8a5b08d4d83c620a697cd (patch) | |
| tree | c6d40bdfe7870bfa4122c25252b19fa781a27bfd /tests/regressiontests | |
| parent | 1ebd6860b65288d8fbe71b7a132f78bed620044d (diff) | |
Corrected an aggregation test failure under PostgreSQL, introduced by r15223. Thanks to Alex for the report.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@15230 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'tests/regressiontests')
| -rw-r--r-- | tests/regressiontests/aggregation_regress/tests.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/regressiontests/aggregation_regress/tests.py b/tests/regressiontests/aggregation_regress/tests.py index 989c4c3d90..ad79923a8a 100644 --- a/tests/regressiontests/aggregation_regress/tests.py +++ b/tests/regressiontests/aggregation_regress/tests.py @@ -479,19 +479,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) |
