mirror of
https://github.com/django/django.git
synced 2024-12-24 18:16:19 +00:00
Fixed #13353: Corrected a couple of tests that were dependent on dictionary ordering. Thanks Alex.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@12984 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
29341aaffc
commit
4604e985ae
@ -131,12 +131,12 @@ True
|
|||||||
# only returned if they are explicitly mentioned.
|
# only returned if they are explicitly mentioned.
|
||||||
>>> TestObject(first='first', second='second', third='third').save()
|
>>> TestObject(first='first', second='second', third='third').save()
|
||||||
|
|
||||||
>>> TestObject.objects.extra(select=SortedDict((('foo','first'),('bar','second'),('whiz','third')))).values()
|
>>> 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'}]
|
||||||
[{'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
|
# Extra clauses after an empty values clause are still included
|
||||||
>>> TestObject.objects.values().extra(select=SortedDict((('foo','first'),('bar','second'),('whiz','third'))))
|
>>> 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'}]
|
||||||
[{'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
|
# 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')
|
>>> TestObject.objects.extra(select=SortedDict((('foo','first'),('bar','second'),('whiz','third')))).values('first', 'second')
|
||||||
|
Loading…
Reference in New Issue
Block a user