summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorRussell Keith-Magee <russell@keith-magee.com>2008-06-15 06:24:41 +0000
committerRussell Keith-Magee <russell@keith-magee.com>2008-06-15 06:24:41 +0000
commit57311b5998900da5a320b9fde7605c834bc0db15 (patch)
tree2ac34806242c35630279aec86720e46975841d77 /tests
parent0b8fafc7f13601235d4bc9bf735ac8dafcc0b04a (diff)
Fixed #7256 -- Corrected queryset code to return the correct set of columns when the query has an empty values() clause as well as extra selects from an extra() clause. Thanks to Nicolas Lara for the report and patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@7636 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'tests')
-rw-r--r--tests/regressiontests/queries/models.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/regressiontests/queries/models.py b/tests/regressiontests/queries/models.py
index 8c9334c849..aa78d6583a 100644
--- a/tests/regressiontests/queries/models.py
+++ b/tests/regressiontests/queries/models.py
@@ -507,6 +507,12 @@ True
>>> [sorted(d.items()) for d in dicts]
[[('id', 1), ('rank', 2)], [('id', 2), ('rank', 1)], [('id', 3), ('rank', 3)]]
+Bug #7256
+# An empty values() call includes all aliases, including those from an extra()
+>>> dicts = qs.values().order_by('id')
+>>> [sorted(d.items()) for d in dicts]
+[[('author_id', 2), ('good', 0), ('id', 1), ('rank', 2)], [('author_id', 3), ('good', 0), ('id', 2), ('rank', 1)], [('author_id', 1), ('good', 1), ('id', 3), ('rank', 3)]]
+
Bugs #2874, #3002
>>> qs = Item.objects.select_related().order_by('note__note', 'name')
>>> list(qs)