diff options
| author | Justin Bronn <jbronn@gmail.com> | 2010-11-06 16:29:19 +0000 |
|---|---|---|
| committer | Justin Bronn <jbronn@gmail.com> | 2010-11-06 16:29:19 +0000 |
| commit | 6c85a44416c1a18c2f5a773752ed403d2f23de99 (patch) | |
| tree | 59c6ce5e1c15daefa9f752d8b386b3ebebea258a | |
| parent | f6824840a2797ee70f5de559e27eee9b7b2207af (diff) | |
Fix for running GEOS/GDAL tests on Python 2.6 and below.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@14474 bcc190cf-cafb-0310-a4f2-bffc1f526a37
| -rw-r--r-- | django/contrib/gis/geometry/test_data.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/django/contrib/gis/geometry/test_data.py b/django/contrib/gis/geometry/test_data.py index 553db471f4..4e073487a5 100644 --- a/django/contrib/gis/geometry/test_data.py +++ b/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 @@ class TestDataMixin(object): # 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 |
