Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Changed model test framework to use meta.get_app() instead of a manua…

…l import

git-svn-id: http://code.djangoproject.com/svn/django/trunk@342 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit a47794c82488c1cf307ee92aff0e5607e03ae0fc 1 parent f6e75ab
@adrianholovaty adrianholovaty authored
Showing with 2 additions and 2 deletions.
  1. +2 −2 tests/runtests.py
View
4 tests/runtests.py
@@ -46,7 +46,7 @@ def output(self, required_level, message):
def run_tests(self):
from django.conf import settings
from django.core.db import db
- from django.core import management
+ from django.core import management, meta
# Manually set INSTALLED_APPS to point to the test app.
settings.INSTALLED_APPS = (APP_NAME,)
@@ -89,7 +89,7 @@ def run_tests(self):
for model_name in test_models:
self.output(1, "%s model: Importing" % model_name)
try:
- mod = __import__(APP_NAME + '.models.' + model_name, '', '', [''])
+ mod = meta.get_app(model_name)
except Exception, e:
log_error(model_name, "Error while importing", ''.join(traceback.format_exception(*sys.exc_info())[1:]))
continue
Please sign in to comment.
Something went wrong with that request. Please try again.