-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
43 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,59 +1,67 @@ | ||
#!/usr/bin/env python | ||
import sys | ||
|
||
import django | ||
from django.conf import settings, global_settings as default_settings | ||
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:',}, | ||
DATABASES={ | ||
"default": { | ||
"ENGINE": "django.db.backends.sqlite3", | ||
"NAME": ":memory:", | ||
}, | ||
}, | ||
SITE_ID = 1, | ||
INSTALLED_APPS = ( | ||
'django.contrib.contenttypes', | ||
'django.contrib.auth', | ||
'django.contrib.sites', | ||
'fluent_contents', | ||
'fluent_contents.tests.testapp', | ||
'fluentcms_cookielaw', | ||
SITE_ID=1, | ||
INSTALLED_APPS=( | ||
"django.contrib.contenttypes", | ||
"django.contrib.auth", | ||
"django.contrib.sites", | ||
"fluent_contents", | ||
"fluent_contents.tests.testapp", | ||
"fluentcms_cookielaw", | ||
), | ||
MIDDLEWARE_CLASSES = (), | ||
TEMPLATES = [ | ||
MIDDLEWARE=(), | ||
TEMPLATES=[ | ||
{ | ||
'BACKEND': 'django.template.backends.django.DjangoTemplates', | ||
'DIRS': (), | ||
'OPTIONS': { | ||
'loaders': ( | ||
'django.template.loaders.filesystem.Loader', | ||
'django.template.loaders.app_directories.Loader', | ||
"BACKEND": "django.template.backends.django.DjangoTemplates", | ||
"DIRS": (), | ||
"OPTIONS": { | ||
"loaders": ( | ||
"django.template.loaders.filesystem.Loader", | ||
"django.template.loaders.app_directories.Loader", | ||
), | ||
'context_processors': ( | ||
'django.template.context_processors.debug', | ||
'django.template.context_processors.i18n', | ||
'django.template.context_processors.media', | ||
'django.template.context_processors.request', | ||
'django.template.context_processors.static', | ||
'django.contrib.auth.context_processors.auth', | ||
"context_processors": ( | ||
"django.template.context_processors.debug", | ||
"django.template.context_processors.i18n", | ||
"django.template.context_processors.media", | ||
"django.template.context_processors.request", | ||
"django.template.context_processors.static", | ||
"django.contrib.auth.context_processors.auth", | ||
), | ||
}, | ||
}, | ||
], | ||
FLUENT_CONTENTS_CACHE_OUTPUT = False, | ||
TEST_RUNNER = 'django.test.simple.DjangoTestSuiteRunner' if django.VERSION < (1,6) else 'django.test.runner.DiscoverRunner', | ||
STATIC_URL = '/static/' | ||
FLUENT_CONTENTS_CACHE_OUTPUT=False, | ||
TEST_RUNNER="django.test.runner.DiscoverRunner", | ||
DEFAULT_AUTO_FIELD="django.db.models.BigAutoField", | ||
STATIC_URL="/static/", | ||
) | ||
|
||
DEFAULT_TEST_APPS = [ | ||
'fluentcms_cookielaw', | ||
"fluentcms_cookielaw", | ||
] | ||
|
||
|
||
def runtests(): | ||
other_args = list(filter(lambda arg: arg.startswith('-'), sys.argv[1:])) | ||
test_apps = list(filter(lambda arg: not arg.startswith('-'), sys.argv[1:])) or DEFAULT_TEST_APPS | ||
argv = sys.argv[:1] + ['test', '--traceback'] + other_args + test_apps | ||
other_args = list(filter(lambda arg: arg.startswith("-"), sys.argv[1:])) | ||
test_apps = ( | ||
list(filter(lambda arg: not arg.startswith("-"), sys.argv[1:])) or DEFAULT_TEST_APPS | ||
) | ||
argv = sys.argv[:1] + ["test", "--traceback"] + other_args + test_apps | ||
execute_from_command_line(argv) | ||
|
||
if __name__ == '__main__': | ||
|
||
if __name__ == "__main__": | ||
runtests() |