summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorRussell Keith-Magee <russell@keith-magee.com>2009-01-20 12:23:48 +0000
committerRussell Keith-Magee <russell@keith-magee.com>2009-01-20 12:23:48 +0000
commit39516803f1e504db5d8a731e8fd3367bb9c016cc (patch)
tree389f2cfae438c25a7d8d8e2d79b3ac8c1046758b /tests
parent728108883a64db4f045827640adc62c09f5b6a8c (diff)
Fixed #10064 -- Corrected handling of aggregate queries that also use select_related(). Thanks to olivius for the report.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@9781 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'tests')
-rw-r--r--tests/regressiontests/aggregation_regress/models.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/tests/regressiontests/aggregation_regress/models.py b/tests/regressiontests/aggregation_regress/models.py
index cb442148bd..ca2447f505 100644
--- a/tests/regressiontests/aggregation_regress/models.py
+++ b/tests/regressiontests/aggregation_regress/models.py
@@ -147,6 +147,9 @@ FieldError: Cannot resolve keyword 'foo' into field. Choices are: authors, id, i
>>> Book.objects.aggregate(number=Max('pages'), select=Max('pages'))
{'number': 1132, 'select': 1132}
+# Regression for #10064: select_related() plays nice with aggregates
+>>> Book.objects.select_related('publisher').annotate(num_authors=Count('authors')).values()[0]
+{'rating': 4.0, 'isbn': u'013790395', 'name': u'Artificial Intelligence: A Modern Approach', 'pubdate': datetime.date(1995, 1, 15), 'price': Decimal("82.8..."), 'id': 5, 'num_authors': 2, 'publisher_id': 3, 'pages': 1132}
"""
}