diff options
| author | Adam Chainz <adam@adamj.eu> | 2016-11-05 11:35:58 +0100 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2016-11-15 11:46:06 -0500 |
| commit | 7c6efb3233ce01db96384483cef47769fba58ce2 (patch) | |
| tree | 2f5e1d90f806f815af45c8d6933c9d17615529c7 /tests/gis_tests | |
| parent | 9da45ff352db1d1b7c64e5c724e9b0b31822b967 (diff) | |
Refs #26753 -- Removed obsolete workarounds in GIS tests for lack of GDAL.
Missed in f7a363ee1d2039824d95f35e54219e09c5af67b0.
Diffstat (limited to 'tests/gis_tests')
| -rw-r--r-- | tests/gis_tests/distapp/models.py | 2 | ||||
| -rw-r--r-- | tests/gis_tests/geo3d/models.py | 3 | ||||
| -rw-r--r-- | tests/gis_tests/geoadmin/models.py | 2 | ||||
| -rw-r--r-- | tests/gis_tests/geoapp/models.py | 2 | ||||
| -rw-r--r-- | tests/gis_tests/geogapp/models.py | 3 | ||||
| -rw-r--r-- | tests/gis_tests/gis_migrations/migrations/0001_initial.py | 11 | ||||
| -rw-r--r-- | tests/gis_tests/inspectapp/models.py | 2 | ||||
| -rw-r--r-- | tests/gis_tests/layermap/models.py | 3 | ||||
| -rw-r--r-- | tests/gis_tests/models.py | 27 | ||||
| -rw-r--r-- | tests/gis_tests/rasterapp/models.py | 3 | ||||
| -rw-r--r-- | tests/gis_tests/relatedapp/models.py | 3 |
11 files changed, 14 insertions, 47 deletions
diff --git a/tests/gis_tests/distapp/models.py b/tests/gis_tests/distapp/models.py index 1632988534..be4cf50f95 100644 --- a/tests/gis_tests/distapp/models.py +++ b/tests/gis_tests/distapp/models.py @@ -1,6 +1,6 @@ +from django.contrib.gis.db import models from django.utils.encoding import python_2_unicode_compatible -from ..models import models from ..utils import gisfield_may_be_null diff --git a/tests/gis_tests/geo3d/models.py b/tests/gis_tests/geo3d/models.py index bcb9e2dc57..f2ea0e02d9 100644 --- a/tests/gis_tests/geo3d/models.py +++ b/tests/gis_tests/geo3d/models.py @@ -1,7 +1,6 @@ +from django.contrib.gis.db import models from django.utils.encoding import python_2_unicode_compatible -from ..models import models - @python_2_unicode_compatible class NamedModel(models.Model): diff --git a/tests/gis_tests/geoadmin/models.py b/tests/gis_tests/geoadmin/models.py index 6945dc0376..e57dcd7e9a 100644 --- a/tests/gis_tests/geoadmin/models.py +++ b/tests/gis_tests/geoadmin/models.py @@ -1,7 +1,7 @@ +from django.contrib.gis.db import models from django.utils.encoding import python_2_unicode_compatible from ..admin import admin -from ..models import models @python_2_unicode_compatible diff --git a/tests/gis_tests/geoapp/models.py b/tests/gis_tests/geoapp/models.py index 764867d66f..62103d268d 100644 --- a/tests/gis_tests/geoapp/models.py +++ b/tests/gis_tests/geoapp/models.py @@ -1,6 +1,6 @@ +from django.contrib.gis.db import models from django.utils.encoding import python_2_unicode_compatible -from ..models import models from ..utils import gisfield_may_be_null diff --git a/tests/gis_tests/geogapp/models.py b/tests/gis_tests/geogapp/models.py index d756a0c2a2..3d2a12826a 100644 --- a/tests/gis_tests/geogapp/models.py +++ b/tests/gis_tests/geogapp/models.py @@ -1,7 +1,6 @@ +from django.contrib.gis.db import models from django.utils.encoding import python_2_unicode_compatible -from ..models import models - @python_2_unicode_compatible class NamedModel(models.Model): diff --git a/tests/gis_tests/gis_migrations/migrations/0001_initial.py b/tests/gis_tests/gis_migrations/migrations/0001_initial.py index e4545dc8aa..d92bb3b0e2 100644 --- a/tests/gis_tests/gis_migrations/migrations/0001_initial.py +++ b/tests/gis_tests/gis_migrations/migrations/0001_initial.py @@ -1,6 +1,5 @@ -from django.db import connection, migrations, models - -from ...models import models as gis_models +from django.contrib.gis.db import models +from django.db import connection, migrations ops = [ migrations.CreateModel( @@ -8,7 +7,7 @@ ops = [ fields=[ ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), ('name', models.CharField(max_length=100, unique=True)), - ('geom', gis_models.MultiPolygonField(srid=4326)), + ('geom', models.MultiPolygonField(srid=4326)), ], options={ 'required_db_features': ['gis_enabled'], @@ -27,7 +26,7 @@ ops = [ )), ('address', models.CharField(max_length=100)), ('zip_code', models.IntegerField(null=True, blank=True)), - ('geom', gis_models.PointField(srid=4326, geography=True)), + ('geom', models.PointField(srid=4326, geography=True)), ], options={ 'required_db_features': ['gis_enabled'], @@ -59,7 +58,7 @@ if connection.features.gis_enabled and connection.features.supports_raster: fields=[ ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), ('name', models.CharField(max_length=100, unique=True)), - ('rast', gis_models.fields.RasterField(srid=4326)), + ('rast', models.fields.RasterField(srid=4326)), ], options={ }, diff --git a/tests/gis_tests/inspectapp/models.py b/tests/gis_tests/inspectapp/models.py index dacb4d48f6..1319ed30e4 100644 --- a/tests/gis_tests/inspectapp/models.py +++ b/tests/gis_tests/inspectapp/models.py @@ -1,4 +1,4 @@ -from ..models import models +from django.contrib.gis.db import models class AllOGRFields(models.Model): diff --git a/tests/gis_tests/layermap/models.py b/tests/gis_tests/layermap/models.py index 1e313049fb..25dd0e4bcd 100644 --- a/tests/gis_tests/layermap/models.py +++ b/tests/gis_tests/layermap/models.py @@ -1,7 +1,6 @@ +from django.contrib.gis.db import models from django.utils.encoding import python_2_unicode_compatible -from ..models import models - @python_2_unicode_compatible class NamedModel(models.Model): diff --git a/tests/gis_tests/models.py b/tests/gis_tests/models.py index aaedf0f8a7..e69de29bb2 100644 --- a/tests/gis_tests/models.py +++ b/tests/gis_tests/models.py @@ -1,27 +0,0 @@ -from django.core.exceptions import ImproperlyConfigured -from django.db import models - - -class DummyField(models.Field): - def __init__(self, dim=None, srid=None, geography=None, spatial_index=True, *args, **kwargs): - super(DummyField, self).__init__(*args, **kwargs) - - -try: - from django.contrib.gis.db import models - # Store a version of the original raster field for testing the exception - # raised if GDAL isn't installed. - models.OriginalRasterField = models.RasterField -except ImproperlyConfigured: - models.GeometryField = DummyField - models.LineStringField = DummyField - models.MultiPointField = DummyField - models.MultiPolygonField = DummyField - models.PointField = DummyField - models.PolygonField = DummyField - models.RasterField = DummyField - -try: - models.RasterField() -except ImproperlyConfigured: - models.RasterField = DummyField diff --git a/tests/gis_tests/rasterapp/models.py b/tests/gis_tests/rasterapp/models.py index 6cd97e40eb..c360d95716 100644 --- a/tests/gis_tests/rasterapp/models.py +++ b/tests/gis_tests/rasterapp/models.py @@ -1,7 +1,6 @@ +from django.contrib.gis.db import models from django.contrib.gis.gdal import HAS_GDAL -from ..models import models - if HAS_GDAL: class RasterModel(models.Model): rast = models.RasterField('A Verbose Raster Name', null=True, srid=4326, spatial_index=True, blank=True) diff --git a/tests/gis_tests/relatedapp/models.py b/tests/gis_tests/relatedapp/models.py index 0052e1797f..32de25bd20 100644 --- a/tests/gis_tests/relatedapp/models.py +++ b/tests/gis_tests/relatedapp/models.py @@ -1,7 +1,6 @@ +from django.contrib.gis.db import models from django.utils.encoding import python_2_unicode_compatible -from ..models import models - class SimpleModel(models.Model): |
