summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMalcolm Tredinnick <malcolm.tredinnick@gmail.com>2007-12-03 03:31:18 +0000
committerMalcolm Tredinnick <malcolm.tredinnick@gmail.com>2007-12-03 03:31:18 +0000
commit7b9732a4a46aae6bf294b1869d58f21909ea91cc (patch)
tree970524a1a7f3f61446d25e75c99f17c4b5926930
parent2c5373c325d00b035e7055bc469793fcbc3132f0 (diff)
queryset-refactor: Added a test for #6074 so that it gets fixed.
git-svn-id: http://code.djangoproject.com/svn/django/branches/queryset-refactor@6859 bcc190cf-cafb-0310-a4f2-bffc1f526a37
-rw-r--r--tests/regressiontests/queries/models.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/tests/regressiontests/queries/models.py b/tests/regressiontests/queries/models.py
index a66f945e18..14ed0bb3b1 100644
--- a/tests/regressiontests/queries/models.py
+++ b/tests/regressiontests/queries/models.py
@@ -197,6 +197,14 @@ Bug #2080, #3592
>>> Author.objects.filter(Q(name='a3') | Q(item__name='one'))
[<Author: a1>, <Author: a3>]
+Bug #6074
+Merging two empty result sets shouldn't leave a queryset with no constraints
+(which would match everything).
+>>> Author.objects.filter(Q(id__in=[]))
+[]
+>>> Author.objects.filter(Q(id__in=[])|Q(id__in=[]))
+[]
+
Bug #1878, #2939
>>> Item.objects.values('creator').distinct().count()
3
@@ -414,7 +422,7 @@ order_by() and filter() calls.
>>> [o.count for o in l]
[2, 2, 1, 0]
-# Filter those items that have exactly one tag attacjed.
+# Filter those items that have exactly one tag attached.
>>> Item.objects.extra(select={'count': 'select count(*) from queries_item_tags where queries_item_tags.item_id = queries_item.id'}).filter(count=1)
[<Item: four>]
"""}