summaryrefslogtreecommitdiff
path: root/django
diff options
context:
space:
mode:
authorJustin Bronn <jbronn@gmail.com>2009-03-20 02:50:48 +0000
committerJustin Bronn <jbronn@gmail.com>2009-03-20 02:50:48 +0000
commit44b0f68f44c4e5ca6f2b9da294dab1db531abc6e (patch)
tree09986e4fb18826d77b58887010e2da0a1be99ffa /django
parent9eb061b2c02a3f1c78c9d323498dffb97a713c32 (diff)
GeoDjango test suite now takes advantage of `importlib` added in r10088.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10103 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django')
-rw-r--r--django/contrib/gis/tests/__init__.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/django/contrib/gis/tests/__init__.py b/django/contrib/gis/tests/__init__.py
index a2abee9173..65e3e96431 100644
--- a/django/contrib/gis/tests/__init__.py
+++ b/django/contrib/gis/tests/__init__.py
@@ -1,4 +1,5 @@
import sys, unittest
+from django.utils.importlib import import_module
def geo_suite():
"""
@@ -45,7 +46,7 @@ def geo_suite():
test_suite_names.append('test_geoip')
for suite_name in test_suite_names:
- tsuite = getattr(__import__('django.contrib.gis.tests', globals(), locals(), [suite_name]), suite_name)
+ tsuite = import_module('django.contrib.gis.tests.' + suite_name)
s.addTest(tsuite.suite())
return s, test_apps
@@ -87,14 +88,13 @@ def run_gis_tests(test_labels, **kwargs):
for test_app in test_apps:
module_name = 'django.contrib.gis.tests.%s' % test_app
if mysql:
- test_module_name = 'tests_mysql'
+ test_module = 'tests_mysql'
else:
- test_module_name = 'tests'
+ test_module = 'tests'
new_installed.append(module_name)
# Getting the model test suite
- tsuite = getattr(__import__('django.contrib.gis.tests.%s' % test_app, globals(), locals(), [test_module_name]),
- test_module_name)
+ tsuite = import_module(module_name + '.' + test_module)
gis_suite.addTest(tsuite.suite())
# Resetting the loaded flag to take into account what we appended to