Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fixed #13353: Corrected a couple of tests that were dependent on dict…

…ionary ordering. Thanks Alex.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@12984 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 4604e985aea1329e521c9cf72208d0cb77f18d60 1 parent 29341aa
Karen Tracey authored April 15, 2010
8  tests/regressiontests/extra_regress/models.py
@@ -131,12 +131,12 @@ def __unicode__(self):
131 131
 # only returned if they are explicitly mentioned.
132 132
 >>> TestObject(first='first', second='second', third='third').save()
133 133
 
134  
->>> TestObject.objects.extra(select=SortedDict((('foo','first'),('bar','second'),('whiz','third')))).values()
135  
-[{'bar': u'second', 'third': u'third', 'second': u'second', 'whiz': u'third', 'foo': u'first', 'id': 1, 'first': u'first'}]
  134
+>>> list(TestObject.objects.extra(select=SortedDict((('foo','first'),('bar','second'),('whiz','third')))).values()) == [{'bar': u'second', 'third': u'third', 'second': u'second', 'whiz': u'third', 'foo': u'first', 'id': 1, 'first': u'first'}]
  135
+True
136 136
 
137 137
 # Extra clauses after an empty values clause are still included
138  
->>> TestObject.objects.values().extra(select=SortedDict((('foo','first'),('bar','second'),('whiz','third'))))
139  
-[{'bar': u'second', 'third': u'third', 'second': u'second', 'whiz': u'third', 'foo': u'first', 'id': 1, 'first': u'first'}]
  138
+>>> list(TestObject.objects.values().extra(select=SortedDict((('foo','first'),('bar','second'),('whiz','third'))))) == [{'bar': u'second', 'third': u'third', 'second': u'second', 'whiz': u'third', 'foo': u'first', 'id': 1, 'first': u'first'}]
  139
+True
140 140
 
141 141
 # Extra columns are ignored if not mentioned in the values() clause
142 142
 >>> TestObject.objects.extra(select=SortedDict((('foo','first'),('bar','second'),('whiz','third')))).values('first', 'second')

0 notes on commit 4604e98

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