Commit 10566a15 authored by Martin Mahner's avatar Martin Mahner Committed by Stéphane Angel

Migrated test settings and runner to Django >= 1.3.

parent 65b91e12
#!/usr/bin/env python #!/usr/bin/env python
import sys import sys
from os.path import dirname, abspath from os.path import dirname, abspath
from django.conf import settings from django.conf import settings
if not settings.configured: if not settings.configured:
settings.configure( settings.configure(
DATABASE_ENGINE='sqlite3', DATABASES = {
INSTALLED_APPS=[ 'default': {
'ENGINE': 'django.db.backends.sqlite3',
}
},
INSTALLED_APPS = [
'tests.testapp', 'tests.testapp',
] ]
) )
from django.test.simple import run_tests from django.test.simple import DjangoTestSuiteRunner
def runtests(*test_args): def runtests(*test_args):
if not test_args: if not test_args:
test_args = ['testapp'] test_args = ['testapp']
parent = dirname(abspath(__file__)) parent = dirname(abspath(__file__))
sys.path.insert(0, parent) sys.path.insert(0, parent)
failures = run_tests(test_args, verbosity=1, interactive=True) runner = DjangoTestSuiteRunner(verbosity=1, interactive=True)
failures = runner.run_tests(test_args)
sys.exit(failures) sys.exit(failures)
......
DEBUG = True DEBUG = True
DATABASE_ENGINE = 'sqlite3' DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
}
}
INSTALLED_APPS = [ INSTALLED_APPS = [
'tests.testapp', 'tests.testapp',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment