Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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
Malcolm Tredinnick authored December 03, 2007
10  tests/regressiontests/queries/models.py
@@ -197,6 +197,14 @@ class Y(models.Model):
197 197
 >>> Author.objects.filter(Q(name='a3') | Q(item__name='one'))
198 198
 [<Author: a1>, <Author: a3>]
199 199
 
  200
+Bug #6074
  201
+Merging two empty result sets shouldn't leave a queryset with no constraints
  202
+(which would match everything).
  203
+>>> Author.objects.filter(Q(id__in=[]))
  204
+[]
  205
+>>> Author.objects.filter(Q(id__in=[])|Q(id__in=[]))
  206
+[]
  207
+
200 208
 Bug #1878, #2939
201 209
 >>> Item.objects.values('creator').distinct().count()
202 210
 3
@@ -414,7 +422,7 @@ class Y(models.Model):
414 422
 >>> [o.count for o in l]
415 423
 [2, 2, 1, 0]
416 424
 
417  
-# Filter those items that have exactly one tag attacjed.
  425
+# Filter those items that have exactly one tag attached.
418 426
 >>> Item.objects.extra(select={'count': 'select count(*) from queries_item_tags where queries_item_tags.item_id = queries_item.id'}).filter(count=1)
419 427
 [<Item: four>]
420 428
 """}

0 notes on commit 7b9732a

Please sign in to comment.
Something went wrong with that request. Please try again.