diff options
| author | Karen Tracey <kmtracey@gmail.com> | 2010-04-15 19:14:52 +0000 |
|---|---|---|
| committer | Karen Tracey <kmtracey@gmail.com> | 2010-04-15 19:14:52 +0000 |
| commit | 8092d3b23faab1b4737845c9f9b30895adb0fab8 (patch) | |
| tree | 0354f8921cb4f0ec1306d44855d3d355de8b9236 /tests | |
| parent | ce8367f1c8c8c891422048d708e5be45dc749e11 (diff) | |
[1.1.X] Fixed #13353: Corrected a couple of tests that were dependent 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
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/regressiontests/extra_regress/models.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/regressiontests/extra_regress/models.py b/tests/regressiontests/extra_regress/models.py index 65c53e65b3..32cf93617f 100644 --- a/tests/regressiontests/extra_regress/models.py +++ b/tests/regressiontests/extra_regress/models.py @@ -129,12 +129,12 @@ True # 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') |
