summaryrefslogtreecommitdiff
path: root/tests/gis_tests
diff options
context:
space:
mode:
authorMariusz Felisiak <felisiak.mariusz@gmail.com>2022-01-20 18:54:29 +0100
committerGitHub <noreply@github.com>2022-01-20 18:54:29 +0100
commitf605e85af9763a3940369bb79462f2cb466288f6 (patch)
tree7f7e27fdfe15b80c4e9ddabefc85dd91ebc513ab /tests/gis_tests
parent2c76c27a951ee76c6f763a05c7e119305a21c78d (diff)
downloaddjango-f605e85af9763a3940369bb79462f2cb466288f6.tar.gz
Fixed #33453 -- Dropped support for GDAL 2.1.
Diffstat (limited to 'tests/gis_tests')
-rw-r--r--tests/gis_tests/inspectapp/tests.py11
1 files changed, 5 insertions, 6 deletions
diff --git a/tests/gis_tests/inspectapp/tests.py b/tests/gis_tests/inspectapp/tests.py
index 932d5bd9ab..35337897c0 100644
--- a/tests/gis_tests/inspectapp/tests.py
+++ b/tests/gis_tests/inspectapp/tests.py
@@ -60,7 +60,6 @@ class InspectDbTests(TestCase):
INSTALLED_APPS={'append': 'django.contrib.gis'},
)
class OGRInspectTest(SimpleTestCase):
- expected_srid = 'srid=-1' if GDAL_VERSION < (2, 2) else ''
maxDiff = 1024
def test_poly(self):
@@ -76,7 +75,7 @@ class OGRInspectTest(SimpleTestCase):
' float = models.FloatField()',
' int = models.BigIntegerField()',
' str = models.CharField(max_length=80)',
- ' geom = models.PolygonField(%s)' % self.expected_srid,
+ ' geom = models.PolygonField()',
]
self.assertEqual(model_def, '\n'.join(expected))
@@ -84,7 +83,7 @@ class OGRInspectTest(SimpleTestCase):
def test_poly_multi(self):
shp_file = os.path.join(TEST_DATA, 'test_poly', 'test_poly.shp')
model_def = ogrinspect(shp_file, 'MyModel', multi_geom=True)
- self.assertIn('geom = models.MultiPolygonField(%s)' % self.expected_srid, model_def)
+ self.assertIn('geom = models.MultiPolygonField()', model_def)
# Same test with a 25D-type geometry field
shp_file = os.path.join(TEST_DATA, 'gas_lines', 'gas_leitung.shp')
model_def = ogrinspect(shp_file, 'MyModel', multi_geom=True)
@@ -105,7 +104,7 @@ class OGRInspectTest(SimpleTestCase):
' population = models.BigIntegerField()',
' density = models.FloatField()',
' created = models.DateField()',
- ' geom = models.PointField(%s)' % self.expected_srid,
+ ' geom = models.PointField()',
]
self.assertEqual(model_def, '\n'.join(expected))
@@ -165,7 +164,7 @@ class OGRInspectTest(SimpleTestCase):
def test_mapping_option(self):
expected = (
- " geom = models.PointField(%s)\n"
+ " geom = models.PointField()\n"
"\n"
"\n"
"# Auto-generated `LayerMapping` dictionary for City model\n"
@@ -175,7 +174,7 @@ class OGRInspectTest(SimpleTestCase):
" 'density': 'Density',\n"
" 'created': 'Created',\n"
" 'geom': 'POINT',\n"
- "}\n" % self.expected_srid)
+ "}\n")
shp_file = os.path.join(TEST_DATA, 'cities', 'cities.shp')
out = StringIO()
call_command('ogrinspect', shp_file, '--mapping', 'City', stdout=out)