Permalink
Fetching contributors…
Cannot retrieve contributors at this time
49 lines (41 sloc) 1.37 KB
# -*- coding: utf-8 -*-
import sys
from django.conf import settings
from django.core.management import execute_from_command_line
if not settings.configured:
settings.configure(
DATABASES={
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': ':memory:'
},
},
INSTALLED_APPS=(
'django.contrib.contenttypes',
'django.contrib.auth',
'django.contrib.sessions',
'django.contrib.messages',
'sifac',
),
MIDDLEWARE_CLASSES=(
'django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware'
),
ROOT_URLCONF=None,
USE_TZ=True,
SECRET_KEY='foobar',
# SILENCED_SYSTEM_CHECKS=['1_7.W001'],
)
def runtests():
argv = sys.argv[:1] + ['test'] + sys.argv[1:]
execute_from_command_line(argv)
if __name__ == '__main__':
runtests()
# loader = unittest.TestLoader()
# extra_suite = unittest.TestSuite(tests=loader.discover('tests/'))
#
# test_runner = get_runner(settings)(verbosity=2, interactive=True)
# failures = test_runner.run_tests(['sifac'], extra_tests=extra_suite)
# sys.exit(failures)