Author: kmtracey Date: 2010-04-15 14:11:02 -0500 (Thu, 15 Apr 2010) New Revision: 12984
Modified: django/trunk/tests/regressiontests/extra_regress/models.py Log: Fixed #13353: Corrected a couple of tests that were dependent on dictionary ordering. Thanks Alex. Modified: django/trunk/tests/regressiontests/extra_regress/models.py =================================================================== --- django/trunk/tests/regressiontests/extra_regress/models.py 2010-04-15 18:49:37 UTC (rev 12983) +++ django/trunk/tests/regressiontests/extra_regress/models.py 2010-04-15 19:11:02 UTC (rev 12984) @@ -131,12 +131,12 @@ # 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') -- You received this message because you are subscribed to the Google Groups "Django updates" group. To post to this group, send email to django-upda...@googlegroups.com. To unsubscribe from this group, send email to django-updates+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-updates?hl=en.