Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fixed error when trying to import the GEOS tests from their new locat…

…ion.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@10137 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 91ebe9acaebff65cdf2b8bab0828bb9badff5179 1 parent fd46f67
Justin Bronn authored March 24, 2009

Showing 1 changed file with 7 additions and 12 deletions. Show diff stats Hide diff stats

  1. 19  django/contrib/gis/tests/__init__.py
19  django/contrib/gis/tests/__init__.py
@@ -204,21 +204,16 @@ def run_tests(test_labels, verbosity=1, interactive=True, extra_tests=[], suite=
204 204
 # Class for creating a fake module with a run method.  This is for the
205 205
 # GEOS and GDAL tests that were moved to their respective modules.
206 206
 class _DeprecatedTestModule(object):
207  
-    def __init__(self, tests, mod):
208  
-        self.tests = tests
209  
-        self.mod = mod
  207
+    def __init__(self, mod_name):
  208
+        self.mod_name = mod_name
210 209
 
211 210
     def run(self):
212 211
         from warnings import warn
213 212
         warn('This test module is deprecated because it has moved to ' \
214 213
              '`django.contrib.gis.%s.tests` and will disappear in 1.2.' %
215  
-             self.mod, DeprecationWarning)
216  
-        self.tests.run()
  214
+             self.mod_name, DeprecationWarning)
  215
+        tests = import_module('django.contrib.gis.%s.tests' % self.mod_name)
  216
+        tests.run()
217 217
 
218  
-from django.contrib.gis.geos import tests as _tests
219  
-test_geos = _DeprecatedTestModule(_tests, 'geos')
220  
-
221  
-from django.contrib.gis.gdal import HAS_GDAL
222  
-if HAS_GDAL:
223  
-    from django.contrib.gis.gdal import tests as _tests
224  
-    test_gdal = _DeprecatedTestModule(_tests, 'gdal')
  218
+test_geos = _DeprecatedTestModule('geos')
  219
+test_gdal = _DeprecatedTestModule('gdal')

0 notes on commit 91ebe9a

Please sign in to comment.
Something went wrong with that request. Please try again.