Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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
  • Loading branch information...
commit 7b9732a4a46aae6bf294b1869d58f21909ea91cc 1 parent 2c5373c
@malcolmt malcolmt authored
Showing with 9 additions and 1 deletion.
  1. +9 −1 tests/regressiontests/queries/models.py
View
10 tests/regressiontests/queries/models.py
@@ -197,6 +197,14 @@ class Y(models.Model):
>>> 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 @@ class Y(models.Model):
>>> [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>]
"""}
Please sign in to comment.
Something went wrong with that request. Please try again.