summaryrefslogtreecommitdiff
path: root/tests/gis_tests/test_spatialrefsys.py
diff options
context:
space:
mode:
authorTim Graham <timograham@gmail.com>2020-11-14 09:08:30 -0500
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2021-01-13 09:22:44 +0100
commite3ece0144a988bc522c4bd551baecaf2139ce4ed (patch)
tree03d6fdb1099fccfa0663c358cdd4955a74fec434 /tests/gis_tests/test_spatialrefsys.py
parent9f91122ed85c07247038c3d6cbc1a1c3fd909ed6 (diff)
Removed redundant database vendor helpers in gis_tests/utils.py.
Diffstat (limited to 'tests/gis_tests/test_spatialrefsys.py')
-rw-r--r--tests/gis_tests/test_spatialrefsys.py21
1 files changed, 8 insertions, 13 deletions
diff --git a/tests/gis_tests/test_spatialrefsys.py b/tests/gis_tests/test_spatialrefsys.py
index bd24aaed00..548be7f54c 100644
--- a/tests/gis_tests/test_spatialrefsys.py
+++ b/tests/gis_tests/test_spatialrefsys.py
@@ -4,8 +4,6 @@ from django.db import connection
from django.test import TestCase, skipUnlessDBFeature
from django.utils.functional import cached_property
-from .utils import oracle, postgis, spatialite
-
test_srs = ({
'srid': 4326,
'auth_name': ('EPSG', True),
@@ -75,13 +73,15 @@ class SpatialRefSysTest(TestCase):
# also, Oracle Spatial seems to add extraneous info to fields, hence the
# the testing with the 'startswith' flag.
auth_name, oracle_flag = sd['auth_name']
- if postgis or (oracle and oracle_flag):
- self.assertTrue(srs.auth_name.startswith(auth_name))
+ # Compare case-insensitively because srs.auth_name is lowercase
+ # ("epsg") on Spatialite.
+ if not connection.ops.oracle or oracle_flag:
+ self.assertIs(srs.auth_name.upper().startswith(auth_name), True)
self.assertEqual(sd['auth_srid'], srs.auth_srid)
- # No PROJ and different srtext on oracle backends :(
- if postgis:
+ # No PROJ and different srtext on Oracle.
+ if not connection.ops.oracle:
self.assertTrue(srs.wkt.startswith(sd['srtext']))
self.assertRegex(srs.proj4text, sd['proj_re'])
@@ -94,14 +94,9 @@ class SpatialRefSysTest(TestCase):
self.assertTrue(sr.spheroid.startswith(sd['spheroid']))
self.assertEqual(sd['geographic'], sr.geographic)
self.assertEqual(sd['projected'], sr.projected)
-
- if not (spatialite and not sd['spatialite']):
- # Can't get 'NAD83 / Texas South Central' from PROJ string
- # on SpatiaLite
- self.assertTrue(sr.name.startswith(sd['name']))
-
+ self.assertIs(sr.name.startswith(sd['name']), True)
# Testing the SpatialReference object directly.
- if postgis or spatialite:
+ if not connection.ops.oracle:
srs = sr.srs
self.assertRegex(srs.proj, sd['proj_re'])
self.assertTrue(srs.wkt.startswith(sd['srtext']))