2012-05-05 16:09:04 +02:00
|
|
|
"""
|
|
|
|
Runner for tests
|
|
|
|
"""
|
|
|
|
|
|
|
|
import sys
|
|
|
|
import os
|
|
|
|
from os.path import dirname, abspath
|
|
|
|
from django.conf import settings
|
|
|
|
|
2012-05-07 10:19:48 +02:00
|
|
|
EUSCAN_ROOT = os.path.join(dirname(dirname(abspath(__file__))), "euscanwww")
|
|
|
|
|
2012-05-05 16:09:04 +02:00
|
|
|
settings.configure(
|
|
|
|
DATABASES={
|
2012-05-07 19:09:08 +02:00
|
|
|
'default': {'ENGINE': 'django.db.backends.sqlite3', 'NAME': ':memory:'}
|
2012-05-05 16:09:04 +02:00
|
|
|
},
|
2012-07-10 16:15:06 +02:00
|
|
|
INSTALLED_APPS=['euscanwww.euscanwww', 'djeuscan', 'django.contrib.auth',
|
|
|
|
'django.contrib.contenttypes'],
|
2012-05-05 16:09:04 +02:00
|
|
|
ROOT_URLCONF='euscanwww.euscanwww.urls',
|
2012-05-07 10:19:48 +02:00
|
|
|
EUSCAN_ROOT=EUSCAN_ROOT,
|
2012-05-13 14:10:57 +02:00
|
|
|
RRD_ROOT=os.path.join(EUSCAN_ROOT, 'var', 'rrd'),
|
2012-07-10 16:15:06 +02:00
|
|
|
USE_TZ=True,
|
|
|
|
TASKS_CONCURRENTLY=8,
|
|
|
|
TASKS_SUBTASK_PACKAGES=32,
|
2012-05-05 16:09:04 +02:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
def runtests():
|
|
|
|
import django.test.utils
|
|
|
|
|
|
|
|
parent = dirname(abspath(__file__))
|
|
|
|
sys.path.insert(0, parent)
|
|
|
|
|
|
|
|
runner_class = django.test.utils.get_runner(settings)
|
|
|
|
test_runner = runner_class(verbosity=1, interactive=True)
|
|
|
|
failures = test_runner.run_tests(['djeuscan'])
|
|
|
|
|
|
|
|
sys.exit(failures)
|