diff options
| author | Justin Bronn <jbronn@gmail.com> | 2009-03-24 04:26:56 +0000 |
|---|---|---|
| committer | Justin Bronn <jbronn@gmail.com> | 2009-03-24 04:26:56 +0000 |
| commit | 91ebe9acaebff65cdf2b8bab0828bb9badff5179 (patch) | |
| tree | 24980a94eb1948ace5e3b3a913bbbb74752f9383 | |
| parent | fd46f673bd83d8ed26ed54075439236e65f2d015 (diff) | |
Fixed error when trying to import the GEOS tests from their new location.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10137 bcc190cf-cafb-0310-a4f2-bffc1f526a37
| -rw-r--r-- | django/contrib/gis/tests/__init__.py | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/django/contrib/gis/tests/__init__.py b/django/contrib/gis/tests/__init__.py index 73eceafeeb..7a3ac25aa1 100644 --- a/django/contrib/gis/tests/__init__.py +++ b/django/contrib/gis/tests/__init__.py @@ -204,21 +204,16 @@ def run_tests(test_labels, verbosity=1, interactive=True, extra_tests=[], suite= # Class for creating a fake module with a run method. This is for the # GEOS and GDAL tests that were moved to their respective modules. class _DeprecatedTestModule(object): - def __init__(self, tests, mod): - self.tests = tests - self.mod = mod + def __init__(self, mod_name): + self.mod_name = mod_name def run(self): from warnings import warn warn('This test module is deprecated because it has moved to ' \ '`django.contrib.gis.%s.tests` and will disappear in 1.2.' % - self.mod, DeprecationWarning) - self.tests.run() + self.mod_name, DeprecationWarning) + tests = import_module('django.contrib.gis.%s.tests' % self.mod_name) + tests.run() -from django.contrib.gis.geos import tests as _tests -test_geos = _DeprecatedTestModule(_tests, 'geos') - -from django.contrib.gis.gdal import HAS_GDAL -if HAS_GDAL: - from django.contrib.gis.gdal import tests as _tests - test_gdal = _DeprecatedTestModule(_tests, 'gdal') +test_geos = _DeprecatedTestModule('geos') +test_gdal = _DeprecatedTestModule('gdal') |
