Django

Code

Show
Ignore:
Timestamp:
06/06/08 06:47:47 (7 months ago)
Author:
russellm
Message:

Fixed #7366 -- Modified a few expected test outputs to remove the dependency on dictionary ordering. Thanks for the patch, Leo Soto.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/trunk/tests/modeltests/basic/models.py

    r7502 r7575  
    402402# The 'select' argument to extra() supports names with dashes in them, as long 
    403403# as you use values(). 
    404 >>> Article.objects.filter(pub_date__year=2008).extra(select={'dashed-value': '1'}).values('headline', 'dashed-value') 
    405 [{'headline': u'Article 11', 'dashed-value': 1}, {'headline': u'Article 12', 'dashed-value': 1}] 
     404>>> dicts = Article.objects.filter(pub_date__year=2008).extra(select={'dashed-value': '1'}).values('headline', 'dashed-value') 
     405>>> [sorted(d.items()) for d in dicts] 
     406[[('dashed-value', 1), ('headline', u'Article 11')], [('dashed-value', 1), ('headline', u'Article 12')]] 
    406407 
    407408# If you use 'select' with extra() and names containing dashes on a query