Fixed #8770: made some tests more robust under MySQL. Thanks, Alex Gaynor.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@8821 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Jacob Kaplan-Moss 2008-09-01 22:28:18 +00:00
parent d86a702d37
commit fc4948d574
1 changed files with 10 additions and 10 deletions

View File

@ -98,12 +98,12 @@ __test__ = {'API_TESTS':"""
[<Place: Guido's House of Pasta the place>, <Place: Main St the place>] [<Place: Guido's House of Pasta the place>, <Place: Main St the place>]
>>> dicts = Restaurant.objects.values('name','serves_hot_dogs') >>> dicts = Restaurant.objects.values('name','serves_hot_dogs')
>>> [sorted(d.items()) for d in dicts] >>> [sorted(d.items()) for d in dicts] == [[('name', u"Guido's House of Pasta"), ('serves_hot_dogs', True)]]
[[('name', u"Guido's House of Pasta"), ('serves_hot_dogs', True)]] True
>>> dicts = ItalianRestaurant.objects.values('name','serves_hot_dogs','serves_gnocchi') >>> dicts = ItalianRestaurant.objects.values('name','serves_hot_dogs','serves_gnocchi')
>>> [sorted(d.items()) for d in dicts] >>> [sorted(d.items()) for d in dicts] == [[('name', u"Guido's House of Pasta"), ('serves_gnocchi', True), ('serves_hot_dogs', True)]]
[[('name', u"Guido's House of Pasta"), ('serves_gnocchi', True), ('serves_hot_dogs', True)]] True
>>> dicts = ParkingLot.objects.values('name','capacity') >>> dicts = ParkingLot.objects.values('name','capacity')
>>> [sorted(d.items()) for d in dicts] >>> [sorted(d.items()) for d in dicts]
@ -130,12 +130,12 @@ __test__ = {'API_TESTS':"""
[<Place: Derelict lot the place>, <Place: Guido's All New House of Pasta the place>] [<Place: Derelict lot the place>, <Place: Guido's All New House of Pasta the place>]
>>> dicts = Restaurant.objects.values('name','serves_hot_dogs') >>> dicts = Restaurant.objects.values('name','serves_hot_dogs')
>>> [sorted(d.items()) for d in dicts] >>> [sorted(d.items()) for d in dicts] == [[('name', u"Guido's All New House of Pasta"), ('serves_hot_dogs', False)]]
[[('name', u"Guido's All New House of Pasta"), ('serves_hot_dogs', False)]] True
>>> dicts = ItalianRestaurant.objects.values('name','serves_hot_dogs','serves_gnocchi') >>> dicts = ItalianRestaurant.objects.values('name','serves_hot_dogs','serves_gnocchi')
>>> [sorted(d.items()) for d in dicts] >>> [sorted(d.items()) for d in dicts] == [[('name', u"Guido's All New House of Pasta"), ('serves_gnocchi', False), ('serves_hot_dogs', False)]]
[[('name', u"Guido's All New House of Pasta"), ('serves_gnocchi', False), ('serves_hot_dogs', False)]] True
>>> dicts = ParkingLot.objects.values('name','capacity') >>> dicts = ParkingLot.objects.values('name','capacity')
>>> [sorted(d.items()) for d in dicts] >>> [sorted(d.items()) for d in dicts]
@ -150,8 +150,8 @@ __test__ = {'API_TESTS':"""
# Note that the name has not changed # Note that the name has not changed
# - name is an attribute of Place, not ItalianRestaurant # - name is an attribute of Place, not ItalianRestaurant
>>> dicts = ItalianRestaurant.objects.values('name','serves_hot_dogs','serves_gnocchi') >>> dicts = ItalianRestaurant.objects.values('name','serves_hot_dogs','serves_gnocchi')
>>> [sorted(d.items()) for d in dicts] >>> [sorted(d.items()) for d in dicts] == [[('name', u"Guido's All New House of Pasta"), ('serves_gnocchi', False), ('serves_hot_dogs', False)]]
[[('name', u"Guido's All New House of Pasta"), ('serves_gnocchi', False), ('serves_hot_dogs', False)]] True
# Regressions tests for #7105: dates() queries should be able to use fields # Regressions tests for #7105: dates() queries should be able to use fields
# from the parent model as easily as the child. # from the parent model as easily as the child.