From 023b70415b689f18115b7bf3842ed6d57c90fa8d Mon Sep 17 00:00:00 2001 From: Claude Paroz Date: Thu, 14 Jun 2012 21:44:08 +0200 Subject: [PATCH] Executed SpatialRefSysTest only with spatial backend --- django/contrib/gis/tests/test_spatialrefsys.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/django/contrib/gis/tests/test_spatialrefsys.py b/django/contrib/gis/tests/test_spatialrefsys.py index b91d03c2e5..6ce72b51f0 100644 --- a/django/contrib/gis/tests/test_spatialrefsys.py +++ b/django/contrib/gis/tests/test_spatialrefsys.py @@ -28,14 +28,18 @@ test_srs = ({'srid' : 4326, }, ) +HAS_SPATIALREFSYS = True if oracle: from django.contrib.gis.db.backends.oracle.models import SpatialRefSys elif postgis: from django.contrib.gis.db.backends.postgis.models import SpatialRefSys elif spatialite: from django.contrib.gis.db.backends.spatialite.models import SpatialRefSys +else: + HAS_SPATIALREFSYS = False -@unittest.skipUnless(HAS_GDAL, "SpatialRefSysTest needs gdal support") +@unittest.skipUnless(HAS_GDAL and HAS_SPATIALREFSYS, + "SpatialRefSysTest needs gdal support and a spatial database") class SpatialRefSysTest(unittest.TestCase): @no_mysql