diff options
author | Claude Paroz <claude@2xlibre.net> | 2017-01-07 12:11:46 +0100 |
---|---|---|
committer | Claude Paroz <claude@2xlibre.net> | 2017-01-18 21:33:28 +0100 |
commit | 2b281cc35ed9d997614ca3c416928d7fabfef1ad (patch) | |
tree | d3e73cf44b15139aa9f1f53e398942ba64f5e190 /tests/gis_tests/geos_tests | |
parent | 7b2f2e74adb36a4334e83130f6abc2f79d395235 (diff) | |
download | django-2b281cc35ed9d997614ca3c416928d7fabfef1ad.tar.gz |
Refs #23919 -- Removed most of remaining six usage
Thanks Tim Graham for the review.
Diffstat (limited to 'tests/gis_tests/geos_tests')
-rw-r--r-- | tests/gis_tests/geos_tests/test_geos.py | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/tests/gis_tests/geos_tests/test_geos.py b/tests/gis_tests/geos_tests/test_geos.py index 7877e1f2d6..f7024e790e 100644 --- a/tests/gis_tests/geos_tests/test_geos.py +++ b/tests/gis_tests/geos_tests/test_geos.py @@ -1,5 +1,6 @@ import ctypes import json +import pickle import random from binascii import a2b_hex, b2a_hex from io import BytesIO @@ -18,7 +19,6 @@ from django.template import Context from django.template.engine import Engine from django.test import SimpleTestCase, mock from django.utils.encoding import force_bytes -from django.utils.six.moves import range from ..test_data import TestDataMixin @@ -1100,10 +1100,6 @@ class GEOSTest(SimpleTestCase, TestDataMixin): def test_pickle(self): "Testing pickling and unpickling support." - # Using both pickle and cPickle -- just 'cause. - from django.utils.six.moves import cPickle - import pickle - # Creating a list of test geometries for pickling, # and setting the SRID on some of them. def get_geoms(lst, srid=None): @@ -1114,11 +1110,10 @@ class GEOSTest(SimpleTestCase, TestDataMixin): tgeoms.extend(get_geoms(self.geometries.multipolygons, 3857)) for geom in tgeoms: - s1, s2 = cPickle.dumps(geom), pickle.dumps(geom) - g1, g2 = cPickle.loads(s1), pickle.loads(s2) - for tmpg in (g1, g2): - self.assertEqual(geom, tmpg) - self.assertEqual(geom.srid, tmpg.srid) + s1 = pickle.dumps(geom) + g1 = pickle.loads(s1) + self.assertEqual(geom, g1) + self.assertEqual(geom.srid, g1.srid) def test_prepared(self): "Testing PreparedGeometry support." |