deb-python-django-bootstrap.../runtests.py
tzangms 86a79783ed Merge branch 'fix-tests' of https://github.com/nikolas/django-bootstrap-form into nikolas-fix-tests
Conflicts:
	bootstrapform/fixtures/basic.html
	bootstrapform/fixtures/horizontal.html
	tests/test_settings.py
2015-03-09 14:42:25 +00:00

60 lines
1.4 KiB
Python

#!/usr/bin/env python
import sys
import django
from os.path import dirname, abspath
from django.conf import settings
settings.configure(
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': ':memory:'
}
},
INSTALLED_APPS=[
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'bootstrapform',
],
MIDDLEWARE_CLASSES = (
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
),
SITE_ID=1,
DEBUG=False,
ROOT_URLCONF='',
)
def runtests(**test_args):
from django.test.utils import get_runner
parent = dirname(abspath(__file__))
sys.path.insert(0, parent)
try:
django.setup()
except:
pass
TestRunner = get_runner(settings)
test_runner = TestRunner(verbosity=1, interactive=True)
failures = test_runner.run_tests(['bootstrapform'], test_args)
sys.exit(failures)
if __name__ == '__main__':
runtests(*sys.argv[1:])