Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

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
  • Loading branch information...
commit 964cf1be866e7db410d8a5b08d4d83c620a697cd 1 parent 1ebd686
@freakboy3742 freakboy3742 authored
Showing with 3 additions and 3 deletions.
  1. +3 −3 tests/regressiontests/aggregation_regress/tests.py
View
6 tests/regressiontests/aggregation_regress/tests.py
@@ -479,19 +479,19 @@ def test_values_queryset_non_conflict(self):
# 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)
Please sign in to comment.
Something went wrong with that request. Please try again.