dpaste/runtests.py
Martin Mahner ae27acf1f9 Backwards incompatible: django-mptt removal.
Removal of django-mptt and therefor the removal of a tree based snippet list, due to performance reasons with large snippet counts.

Snippets still have a 'parent' relation if it's an answer of another snippet, however this is no longer a Nested Set. The UI is simplified too and the user can now only compare an answer to it's parent snippet. I believe this is the major use case anyway.
2017-01-19 12:10:35 +01:00

71 lines
1.8 KiB
Python
Executable file

#!/usr/bin/env python
import sys
from django.conf import settings
SETTINGS = {
'DATABASES': {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': 'dev.db',
},
# 'default': {
# 'ENGINE': 'django.db.backends.mysql',
# 'NAME': 'dpaste',
# 'USER': 'root',
# 'PASSWORD': '',
# }
},
'TEMPLATES': [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
'django.template.context_processors.debug',
'django.template.context_processors.request',
],
},
},
],
'INSTALLED_APPS': [
'django.contrib.sessions',
'django.contrib.staticfiles',
'dpaste',
],
'MIDDLEWARE_CLASSES': (
'django.contrib.sessions.middleware.SessionMiddleware',
),
'STATIC_ROOT': '/tmp/dpaste_test_static/',
'STATIC_URL': '/static/',
'ROOT_URLCONF': 'dpaste.urls',
'LANGUAGE_CODE': 'en',
'LANGUAGES': (('en', 'English'),),
}
def runtests(*test_args):
# Setup settings
if not settings.configured:
settings.configure(**SETTINGS)
# New Django 1.7 app registry setup
try:
from django import setup
setup()
except ImportError:
pass
# New Django 1.8 test runner
try:
from django.test.runner import DiscoverRunner as TestRunner
except ImportError:
from django.test.simple import DjangoTestSuiteRunner as TestRunner
test_runner = TestRunner(verbosity=1)
failures = test_runner.run_tests(['dpaste'])
if failures:
sys.exit(failures)
if __name__ == '__main__':
runtests(*sys.argv[1:])