diff options
| author | Claude Paroz <claude@2xlibre.net> | 2015-04-04 18:09:46 +0200 |
|---|---|---|
| committer | Claude Paroz <claude@2xlibre.net> | 2015-04-18 15:17:49 +0200 |
| commit | 6b6d13bf6ed02c345912829e3850a201f113712a (patch) | |
| tree | 7d744ccc557c3939950068f09cba050c843bc05d /tests/gis_tests/layermap | |
| parent | 8097e5483210fa8c9d6142f1d48e1caed6d7b7bb (diff) | |
Stopped conditional discovery of gis_tests apps
Refs #23879.
Diffstat (limited to 'tests/gis_tests/layermap')
| -rw-r--r-- | tests/gis_tests/layermap/models.py | 9 | ||||
| -rw-r--r-- | tests/gis_tests/layermap/tests.py | 3 |
2 files changed, 10 insertions, 2 deletions
diff --git a/tests/gis_tests/layermap/models.py b/tests/gis_tests/layermap/models.py index f2c7882547..4ffcad0486 100644 --- a/tests/gis_tests/layermap/models.py +++ b/tests/gis_tests/layermap/models.py @@ -1,6 +1,7 @@ -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): @@ -10,6 +11,7 @@ class NamedModel(models.Model): class Meta: abstract = True + required_db_features = ['gis_enabled'] def __str__(self): return self.name @@ -38,6 +40,7 @@ class City(NamedModel): class Meta: app_label = 'layermap' + required_db_features = ['gis_enabled'] class Interstate(NamedModel): @@ -46,6 +49,7 @@ class Interstate(NamedModel): class Meta: app_label = 'layermap' + required_db_features = ['gis_enabled'] # Same as `City` above, but for testing model inheritance. @@ -72,6 +76,9 @@ class ICity2(ICity1): class Invalid(models.Model): point = models.PointField() + class Meta: + required_db_features = ['gis_enabled'] + # Mapping dictionaries for the models above. co_mapping = { diff --git a/tests/gis_tests/layermap/tests.py b/tests/gis_tests/layermap/tests.py index e4477189cb..a0abd4030c 100644 --- a/tests/gis_tests/layermap/tests.py +++ b/tests/gis_tests/layermap/tests.py @@ -9,11 +9,12 @@ from unittest import skipUnless from django.conf import settings from django.contrib.gis.gdal import HAS_GDAL +from django.contrib.gis.geos import HAS_GEOS from django.db import connection from django.test import TestCase, override_settings, skipUnlessDBFeature from django.utils._os import upath -if HAS_GDAL: +if HAS_GEOS and HAS_GDAL: from django.contrib.gis.utils.layermapping import (LayerMapping, LayerMapError, InvalidDecimal, InvalidString, MissingForeignKey) from django.contrib.gis.gdal import DataSource |
