From d1d5cf7aa266cc04592e5f122563ae6315870050 Mon Sep 17 00:00:00 2001 From: Justin Bronn Date: Fri, 14 Sep 2007 22:46:41 +0000 Subject: [PATCH] gis: Fixed #5437 with patch from rcoup. git-svn-id: http://code.djangoproject.com/svn/django/branches/gis@6240 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- django/contrib/gis/tests/__init__.py | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/django/contrib/gis/tests/__init__.py b/django/contrib/gis/tests/__init__.py index f2633ae6fb..390fa8e037 100644 --- a/django/contrib/gis/tests/__init__.py +++ b/django/contrib/gis/tests/__init__.py @@ -1,15 +1,24 @@ from copy import copy from unittest import TestSuite, TextTestRunner +import sys # Tests that do not require setting up and tearing down a spatial database. -test_suite_names = ['test_gdal_driver', - 'test_gdal_ds', - 'test_gdal_geom', - 'test_gdal_srs', - 'test_geos', - 'test_measure', - 'test_spatialrefsys', - ] +test_suite_names = [ + 'test_geos', + 'test_measure', +] +try: + # GDAL tests + import django.contrib.gis.gdal + test_suite_names += [ + 'test_gdal_driver', + 'test_gdal_ds', + 'test_gdal_geom', + 'test_gdal_srs', + 'test_spatialrefsys', + ] +except ImportError, e: + print >>sys.stderr, "GDAL not available - no GDAL tests will be run." test_models = ['geoapp']