diff options
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/gis_tests/gdal_tests/test_ds.py | 3 | ||||
| -rw-r--r-- | tests/gis_tests/inspectapp/tests.py | 6 |
2 files changed, 5 insertions, 4 deletions
diff --git a/tests/gis_tests/gdal_tests/test_ds.py b/tests/gis_tests/gdal_tests/test_ds.py index 0de4c282b9..d6a46d5a95 100644 --- a/tests/gis_tests/gdal_tests/test_ds.py +++ b/tests/gis_tests/gdal_tests/test_ds.py @@ -27,7 +27,8 @@ if HAS_GDAL: }, fids=range(5) ), - TestDS('test_vrt', ext='vrt', nfeat=3, nfld=3, geom='POINT', gtype='Point25D', driver='VRT', + TestDS('test_vrt', ext='vrt', nfeat=3, nfld=3, geom='POINT', gtype='Point25D', + driver='OGR_VRT' if GDAL_VERSION >= (2, 0) else 'VRT', fields={ 'POINT_X': OFTString, 'POINT_Y': OFTString, diff --git a/tests/gis_tests/inspectapp/tests.py b/tests/gis_tests/inspectapp/tests.py index ca2dce72de..6525e995ca 100644 --- a/tests/gis_tests/inspectapp/tests.py +++ b/tests/gis_tests/inspectapp/tests.py @@ -14,7 +14,7 @@ from django.utils.six import StringIO from ..test_data import TEST_DATA if HAS_GDAL: - from django.contrib.gis.gdal import Driver, GDALException + from django.contrib.gis.gdal import Driver, GDALException, GDAL_VERSION from django.contrib.gis.utils.ogrinspect import ogrinspect from .models import AllOGRFields @@ -79,7 +79,7 @@ class OGRInspectTest(TestCase): '', 'class MyModel(models.Model):', ' float = models.FloatField()', - ' int = models.FloatField()', + ' int = models.{}()'.format('BigIntegerField' if GDAL_VERSION >= (2, 0) else 'FloatField'), ' str = models.CharField(max_length=80)', ' geom = models.PolygonField(srid=-1)', ' objects = models.GeoManager()', @@ -106,7 +106,7 @@ class OGRInspectTest(TestCase): '', 'class City(models.Model):', ' name = models.CharField(max_length=80)', - ' population = models.FloatField()', + ' population = models.{}()'.format('BigIntegerField' if GDAL_VERSION >= (2, 0) else 'FloatField'), ' density = models.FloatField()', ' created = models.DateField()', ' geom = models.PointField(srid=-1)', |
