diff options
| author | Tim Graham <timograham@gmail.com> | 2017-09-10 23:00:18 -0400 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2017-09-12 09:51:02 -0400 |
| commit | f896eb30f6cabdccaab4f9a7fc5c6cda515fc325 (patch) | |
| tree | 514af8c90a6bd24f68dffba9de85111ac5aa4f2d /tests | |
| parent | f36e5d68d928b9ed8d9702ec58da54deb2d9896e (diff) | |
Removed django.contrib.gis.geometry.backend.
The layer of indirection is unchanged and undocumented
since its introduction in ff60c5f9de3e8690d1e86f3e9e3f7248a15397c8.
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/gis_tests/relatedapp/tests.py | 5 | ||||
| -rw-r--r-- | tests/gis_tests/tests.py | 10 |
2 files changed, 2 insertions, 13 deletions
diff --git a/tests/gis_tests/relatedapp/tests.py b/tests/gis_tests/relatedapp/tests.py index 11a9bd9956..8d6b793ce2 100644 --- a/tests/gis_tests/relatedapp/tests.py +++ b/tests/gis_tests/relatedapp/tests.py @@ -1,5 +1,4 @@ from django.contrib.gis.db.models import Collect, Count, Extent, F, Union -from django.contrib.gis.geometry.backend import Geometry from django.contrib.gis.geos import GEOSGeometry, MultiPoint, Point from django.db import connection from django.test import TestCase, skipUnlessDBFeature @@ -177,8 +176,8 @@ class RelatedGeoModelTest(TestCase): for m, d, t in zip(gqs, gvqs, gvlqs): # The values should be Geometry objects and not raw strings returned # by the spatial database. - self.assertIsInstance(d['point'], Geometry) - self.assertIsInstance(t[1], Geometry) + self.assertIsInstance(d['point'], GEOSGeometry) + self.assertIsInstance(t[1], GEOSGeometry) self.assertEqual(m.point, d['point']) self.assertEqual(m.point, t[1]) diff --git a/tests/gis_tests/tests.py b/tests/gis_tests/tests.py index 2f55406f56..20b66cd39b 100644 --- a/tests/gis_tests/tests.py +++ b/tests/gis_tests/tests.py @@ -8,16 +8,6 @@ try: HAS_POSTGRES = True except ImportError: HAS_POSTGRES = False -except ImproperlyConfigured as e: - # If psycopg is installed but not geos, the import path hits - # django.contrib.gis.geometry.backend which will "helpfully" convert - # an ImportError into an ImproperlyConfigured. - # Here, we make sure we're only catching this specific case and not another - # ImproperlyConfigured one. - if e.args and e.args[0].startswith('Could not import user-defined GEOMETRY_BACKEND'): - HAS_POSTGRES = False - else: - raise if HAS_POSTGRES: |
