summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorIan Kelly <ian.g.kelly@gmail.com>2009-02-25 23:56:00 +0000
committerIan Kelly <ian.g.kelly@gmail.com>2009-02-25 23:56:00 +0000
commit8ffe8981f6944219dabae16e900a5eb00c809316 (patch)
treeacf5d139b072437e51f2785462cd5d32e0abd5cc /tests
parent86a048b4e0dd07d56fafe5d294d5e12b5277a41b (diff)
Fixed #10290: do not use aliases when adding extra_selects to the GROUP BY clause, to generate compliant sql that will be accepted by Oracle.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@9905 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'tests')
-rw-r--r--tests/regressiontests/aggregation_regress/models.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/regressiontests/aggregation_regress/models.py b/tests/regressiontests/aggregation_regress/models.py
index fae0c2673e..96f0ef1139 100644
--- a/tests/regressiontests/aggregation_regress/models.py
+++ b/tests/regressiontests/aggregation_regress/models.py
@@ -230,6 +230,12 @@ FieldError: Cannot resolve keyword 'foo' into field. Choices are: authors, conta
>>> Book.objects.annotate(num_authors=Count('authors')).filter(num_authors=2).dates('pubdate', 'day')
[datetime.datetime(1995, 1, 15, 0, 0), datetime.datetime(2007, 12, 6, 0, 0)]
+# Regression for #10290 - extra selects with parameters can be used for
+# grouping.
+>>> qs = Book.objects.all().annotate(mean_auth_age=Avg('authors__age')).extra(select={'sheets' : '(pages + %s) / %s'}, select_params=[1, 2]).order_by('sheets').values('sheets')
+>>> [int(x['sheets']) for x in qs]
+[150, 175, 224, 264, 473, 566]
+
"""
}