Skip to content

Commit

Permalink
Executed SpatialRefSysTest only with spatial backend
Browse files Browse the repository at this point in the history
  • Loading branch information
claudep committed Jun 14, 2012
1 parent 88601ba commit 023b704
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion django/contrib/gis/tests/test_spatialrefsys.py
Expand Up @@ -28,14 +28,18 @@
},
)

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
Expand Down

0 comments on commit 023b704

Please sign in to comment.