diff options
| author | Justin Bronn <jbronn@gmail.com> | 2007-09-14 22:46:41 +0000 |
|---|---|---|
| committer | Justin Bronn <jbronn@gmail.com> | 2007-09-14 22:46:41 +0000 |
| commit | d1d5cf7aa266cc04592e5f122563ae6315870050 (patch) | |
| tree | 0ef877c3fb26b2ed14fab4cf512af3a53b925e2a | |
| parent | 57135b1cb79214e7a9b4e090de740534c34aa774 (diff) | |
gis: Fixed #5437 with patch from rcoup.
git-svn-id: http://code.djangoproject.com/svn/django/branches/gis@6240 bcc190cf-cafb-0310-a4f2-bffc1f526a37
| -rw-r--r-- | django/contrib/gis/tests/__init__.py | 25 |
1 files 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'] |
