Django

Code

Changeset 6859

Show
Ignore:
Timestamp:
12/02/07 21:31:18 (1 year ago)
Author:
mtredinnick
Message:

queryset-refactor: Added a test for #6074 so that it gets fixed.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/branches/queryset-refactor/tests/regressiontests/queries/models.py

    r6858 r6859  
    198198[<Author: a1>, <Author: a3>] 
    199199 
     200Bug #6074 
     201Merging 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 
    200208Bug #1878, #2939 
    201209>>> Item.objects.values('creator').distinct().count() 
     
    415423[2, 2, 1, 0] 
    416424 
    417 # Filter those items that have exactly one tag attacjed. 
     425# Filter those items that have exactly one tag attached. 
    418426>>> Item.objects.extra(select={'count': 'select count(*) from queries_item_tags where queries_item_tags.item_id = queries_item.id'}).filter(count=1) 
    419427[<Item: four>]