Navigation Menu

Skip to content

Commit

Permalink
[1.1.X] Fixed #13353: Corrected a couple of tests that were dependent…
Browse files Browse the repository at this point in the history
… on dictionary ordering. Thanks Alex.

r12984 from trunk.


git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.1.X@12985 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information
kmtracey committed Apr 15, 2010
1 parent ce8367f commit 8092d3b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tests/regressiontests/extra_regress/models.py
Expand Up @@ -129,12 +129,12 @@ def __unicode__(self):
# only returned if they are explicitly mentioned.
>>> TestObject(first='first', second='second', third='third').save()
>>> 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'}]
>>> 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'}]
True
# Extra clauses after an empty values clause are still included
>>> 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'}]
>>> 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'}]
True
# Extra columns are ignored if not mentioned in the values() clause
>>> TestObject.objects.extra(select=SortedDict((('foo','first'),('bar','second'),('whiz','third')))).values('first', 'second')
Expand Down

0 comments on commit 8092d3b

Please sign in to comment.