summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMalcolm Tredinnick <malcolm.tredinnick@gmail.com>2008-04-23 09:53:22 +0000
committerMalcolm Tredinnick <malcolm.tredinnick@gmail.com>2008-04-23 09:53:22 +0000
commit42dc3b9ba247ea035e2d2855917592bdda5f5812 (patch)
tree380ba8ee19cf65ab2f7570b9ce24db2b7fcd5b70 /tests
parent42260ef73762e17aaab72f1dd306c9c7a5f24640 (diff)
queryset-refactor: Fixed the interaction between extra(select=...) and
valuelist(). Fixed #7053. git-svn-id: http://code.djangoproject.com/svn/django/branches/queryset-refactor@7446 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'tests')
-rw-r--r--tests/modeltests/lookup/models.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/modeltests/lookup/models.py b/tests/modeltests/lookup/models.py
index a18be968aa..d134fb5265 100644
--- a/tests/modeltests/lookup/models.py
+++ b/tests/modeltests/lookup/models.py
@@ -180,6 +180,13 @@ True
>>> Article.objects.valueslist('id', flat=True).order_by('id')
[1, 2, 3, 4, 5, 6, 7]
+>>> Article.objects.extra(select={'id_plus_one': 'id+1'}).order_by('id').valueslist('id')
+[(1,), (2,), (3,), (4,), (5,), (6,), (7,)]
+>>> Article.objects.extra(select={'id_plus_one': 'id+1'}).order_by('id').valueslist('id_plus_one', 'id')
+[(2, 1), (3, 2), (4, 3), (5, 4), (6, 5), (7, 6), (8, 7)]
+>>> Article.objects.extra(select={'id_plus_one': 'id+1'}).order_by('id').valueslist('id', 'id_plus_one')
+[(1, 2), (2, 3), (3, 4), (4, 5), (5, 6), (6, 7), (7, 8)]
+
>>> Article.objects.valueslist('id', 'headline', flat=True)
Traceback (most recent call last):
...