diff --git a/django/contrib/gis/tests/distapp/tests.py b/django/contrib/gis/tests/distapp/tests.py index 2e778d3fce..2ed17a03bd 100644 --- a/django/contrib/gis/tests/distapp/tests.py +++ b/django/contrib/gis/tests/distapp/tests.py @@ -5,7 +5,7 @@ from django.db.models import Q from django.contrib.gis.geos import HAS_GEOS from django.contrib.gis.measure import D # alias for Distance from django.contrib.gis.tests.utils import ( - HAS_SPATIAL_DB, oracle, postgis, spatialite, no_oracle, no_spatialite + HAS_SPATIAL_DB, mysql, oracle, postgis, spatialite, no_oracle, no_spatialite ) from django.test import TestCase from django.utils.unittest import skipUnless @@ -17,8 +17,8 @@ if HAS_GEOS and HAS_SPATIAL_DB: SouthTexasCity, SouthTexasCityFt, CensusZipcode, SouthTexasZipcode) -@skipUnless(HAS_GEOS and HAS_SPATIAL_DB, - "Geos and spatial db are required.") +@skipUnless(HAS_GEOS and HAS_SPATIAL_DB and not mysql, + "Geos and spatial db (not mysql) are required.") class DistanceTest(TestCase): if HAS_GEOS and HAS_SPATIAL_DB: diff --git a/django/contrib/gis/tests/geo3d/tests.py b/django/contrib/gis/tests/geo3d/tests.py index c51c0decd7..df9f35690b 100644 --- a/django/contrib/gis/tests/geo3d/tests.py +++ b/django/contrib/gis/tests/geo3d/tests.py @@ -5,7 +5,7 @@ import re from django.contrib.gis.gdal import HAS_GDAL from django.contrib.gis.geos import HAS_GEOS -from django.contrib.gis.tests.utils import HAS_SPATIAL_DB +from django.contrib.gis.tests.utils import postgis from django.test import TestCase from django.utils._os import upath from django.utils.unittest import skipUnless @@ -62,7 +62,7 @@ bbox_data = ( ) -@skipUnless(HAS_GEOS and HAS_GDAL and HAS_SPATIAL_DB, "Geos, GDAL and spatial db are required.") +@skipUnless(HAS_GEOS and HAS_GDAL and postgis, "Geos, GDAL and postgis are required.") class Geo3DTest(TestCase): """ Only a subset of the PostGIS routines are 3D-enabled, and this TestCase diff --git a/django/contrib/gis/tests/geoapp/tests.py b/django/contrib/gis/tests/geoapp/tests.py index f6de0670c7..cf6e316919 100644 --- a/django/contrib/gis/tests/geoapp/tests.py +++ b/django/contrib/gis/tests/geoapp/tests.py @@ -6,7 +6,7 @@ from django.db import connection from django.contrib.gis import gdal from django.contrib.gis.geos import HAS_GEOS from django.contrib.gis.tests.utils import ( - HAS_SPATIAL_DB, no_mysql, no_oracle, no_spatialite, + no_mysql, no_oracle, no_spatialite, mysql, oracle, postgis, spatialite) from django.test import TestCase from django.utils import six, unittest @@ -27,7 +27,7 @@ def postgis_bug_version(): return spatial_version and (2, 0, 0) <= spatial_version <= (2, 0, 1) -@skipUnless(HAS_GEOS and HAS_SPATIAL_DB, "Geos and spatial db are required.") +@skipUnless(HAS_GEOS and postgis, "Geos and postgis are required.") class GeoModelTest(TestCase): def test_fixtures(self): @@ -202,7 +202,7 @@ class GeoModelTest(TestCase): self.assertTrue(isinstance(cities2[0].point, Point)) -@skipUnless(HAS_GEOS and HAS_SPATIAL_DB, "Geos and spatial db are required.") +@skipUnless(HAS_GEOS and postgis, "Geos and postgis are required.") class GeoLookupTest(TestCase): @no_mysql @@ -388,7 +388,7 @@ class GeoLookupTest(TestCase): self.assertEqual('Lawrence', City.objects.get(point__relate=(ks.poly, intersects_mask)).name) -@skipUnless(HAS_GEOS and HAS_SPATIAL_DB, "Geos and spatial db are required.") +@skipUnless(HAS_GEOS and postgis, "Geos and postgis are required.") class GeoQuerySetTest(TestCase): # Please keep the tests in GeoQuerySet method's alphabetic order diff --git a/django/contrib/gis/tests/geogapp/tests.py b/django/contrib/gis/tests/geogapp/tests.py index 8d3e96b0a9..ed54999f90 100644 --- a/django/contrib/gis/tests/geogapp/tests.py +++ b/django/contrib/gis/tests/geogapp/tests.py @@ -8,7 +8,7 @@ import os from django.contrib.gis.gdal import HAS_GDAL from django.contrib.gis.geos import HAS_GEOS from django.contrib.gis.measure import D -from django.contrib.gis.tests.utils import HAS_SPATIAL_DB +from django.contrib.gis.tests.utils import postgis from django.test import TestCase from django.utils._os import upath from django.utils.unittest import skipUnless @@ -17,7 +17,7 @@ if HAS_GEOS: from .models import City, County, Zipcode -@skipUnless(HAS_GEOS and HAS_SPATIAL_DB, "Geos and spatial db are required.") +@skipUnless(HAS_GEOS and postgis, "Geos and postgis are required.") class GeographyTest(TestCase): def test01_fixture_load(self):