FreedomBox/plinth/tests/data/django_test_settings.py
Sunil Mohan Adapa 9368504da5
*.py: Use SPDX license identifier
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
2020-02-19 14:38:55 +02:00

53 lines
1.1 KiB
Python

# SPDX-License-Identifier: AGPL-3.0-or-later
"""
Django settings for test modules.
"""
import os
TEST_DATA_DIR = os.path.dirname(os.path.abspath(__file__))
AXES_ENABLED = False
CACHES = {
'default': {
'BACKEND': 'django.core.cache.backends.dummy.DummyCache'
}
}
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': os.path.join(TEST_DATA_DIR, 'plinth.sqlite3'),
}
}
INSTALLED_APPS = [
'axes',
'captcha',
'bootstrapform',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.messages',
'stronghold',
'plinth',
]
# These are included here solely to suppress Django warnings
# during testing setup
MIDDLEWARE = (
'django.contrib.sessions.middleware.SessionMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
)
ROOT_URLCONF = 'plinth.tests.data.urls'
SECRET_KEY = 'django_tests_secret_key'
TEMPLATES = [{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'APP_DIRS': True,
'DIRS': ['plinth/tests/data/templates/'],
}]