Django

Code

Changeset 6962

Show
Ignore:
Timestamp:
12/19/07 07:43:16 (1 year ago)
Author:
mtredinnick
Message:

queryset-refactor: Tweaked one test slightly to work around a PostgreSQL oddity.

Files:

Legend:

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

    r6961 r6962  
    456456...     s.reverse() 
    457457...     params.reverse() 
    458 >>> Item.objects.extra(select=SortedDict(s), params=params).values('a','b')[0] 
    459 {'a': u'one', 'b': u'two'} 
     458 
     459# This slightly odd comparison works aorund the fact that PostgreSQL will 
     460# return 'one' and 'two' as strings, not Unicode objects. It's a side-effect of 
     461# using constants here and not a real concern. 
     462>>> d = Item.objects.extra(select=SortedDict(s), params=params).values('a', 'b')[0] 
     463>>> d == {'a': u'one', 'b': u'two'} 
     464True 
    460465 
    461466# Order by the number of tags attached to an item.