Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

[1.2.X] Fix for running GEOS/GDAL tests on Python 2.6 and below.

Backport of r14474 from trunk.

git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.2.X@14475 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit d8e0052d454f581513cd8d3b683093a1f33f12e8 1 parent 24ce503
@jbronn jbronn authored
Showing with 7 additions and 2 deletions.
  1. +7 −2 django/contrib/gis/geometry/test_data.py
View
9 django/contrib/gis/geometry/test_data.py
@@ -23,6 +23,11 @@ def tuplize(seq):
return seq
+def strconvert(d):
+ "Converts all keys in dictionary to str type."
+ return dict([(str(k), v) for k, v in d.iteritems()])
+
+
def get_ds_file(name, ext):
return os.path.join(TEST_DATA,
name,
@@ -81,7 +86,7 @@ class TestGeomSet(object):
"""
def __init__(self, **kwargs):
for key, value in kwargs.items():
- setattr(self, key, [TestGeom(**kwargs) for kwargs in value])
+ setattr(self, key, [TestGeom(**strconvert(kw)) for kw in value])
class TestDataMixin(object):
@@ -96,5 +101,5 @@ def geometries(self):
# Load up the test geometry data from fixture into global.
gzf = gzip.GzipFile(os.path.join(TEST_DATA, 'geometries.json.gz'))
geometries = simplejson.loads(gzf.read())
- GEOMETRIES = TestGeomSet(**geometries)
+ GEOMETRIES = TestGeomSet(**strconvert(geometries))
return GEOMETRIES

0 comments on commit d8e0052

Please sign in to comment.
Something went wrong with that request. Please try again.