fixed issue 1393, cast_keys in dict for python 2.5 support, thanks Alan and Niphlod

This commit is contained in:
mdipierro
2013-03-17 12:11:10 -05:00
parent cd967d2551
commit c9a63a8524
4 changed files with 80 additions and 11 deletions
+7 -1
View File
@@ -7,6 +7,7 @@
import sys
import os
import glob
if os.path.isdir('gluon'):
sys.path.append(os.path.realpath('gluon'))
else:
@@ -659,7 +660,12 @@ class TestDALDictImportExport(unittest.TestCase):
import serializers
dbjson = db.as_json(sanitize=False)
assert isinstance(dbjson, basestring) and len(dbjson) > 0
db3 = DAL(serializers.loads_json(dbjson))
unicode_keys = True
if sys.version < "2.6.5":
unicode_keys = False
db3 = DAL(serializers.loads_json(dbjson,
unicode_keys=unicode_keys))
assert hasattr(db3, "person") and hasattr(db3.person, "uuid") and\
db3.person.uuid.type == db.person.uuid.type
db3.person.drop()