OpenSlides/tests/settings.py

78 lines
1.7 KiB
Python
Raw Normal View History

"""
Settings file for OpenSlides' tests.
"""
2013-03-14 22:18:56 +01:00
import os
from openslides.global_settings import * # noqa
2013-03-14 22:18:56 +01:00
# Path to the directory for user specific data files
OPENSLIDES_USER_DATA_PATH = os.path.realpath(os.path.dirname(os.path.abspath(__file__)))
2013-03-14 22:18:56 +01:00
2019-01-06 16:22:33 +01:00
EMAIL_BACKEND = "django.core.mail.backends.locmem.EmailBackend"
# OpenSlides plugins
# Add plugins to this list.
2019-01-06 16:22:33 +01:00
INSTALLED_PLUGINS += ("tests.integration.test_plugin",) # noqa
2016-06-16 10:59:35 +02:00
INSTALLED_APPS += INSTALLED_PLUGINS # noqa
# Important settings for production use
# https://docs.djangoproject.com/en/1.10/howto/deployment/checklist/
2019-01-06 16:22:33 +01:00
SECRET_KEY = "secret"
DEBUG = False
# Uncomment to test with the redis cache
# REDIS_ADDRESS = "redis://127.0.0.1"
# Database
# https://docs.djangoproject.com/en/1.10/ref/settings/#databases
# Change this setting to use e. g. PostgreSQL or MySQL.
2019-12-11 16:12:58 +01:00
DATABASES = {
"default": {
"ENGINE": "django.db.backends.sqlite3",
"TEST": {"NAME": os.path.join(OPENSLIDES_USER_DATA_PATH, "db.sqlite3.test")},
}
}
SESSION_ENGINE = "django.contrib.sessions.backends.cache"
# Internationalization
# https://docs.djangoproject.com/en/1.10/topics/i18n/
2019-01-06 16:22:33 +01:00
TIME_ZONE = "Europe/Berlin"
# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/1.10/howto/static-files/
2019-01-06 16:22:33 +01:00
STATICFILES_DIRS.insert(0, os.path.join(OPENSLIDES_USER_DATA_PATH, "static")) # noqa
# Files
# https://docs.djangoproject.com/en/1.10/topics/files/
2019-01-06 16:22:33 +01:00
MEDIA_ROOT = os.path.join(OPENSLIDES_USER_DATA_PATH, "")
# Special settings only for testing
# Use a faster password hasher.
2019-01-06 16:22:33 +01:00
PASSWORD_HASHERS = ["django.contrib.auth.hashers.MD5PasswordHasher"]
# Deactivate restricted_data_cache
RESTRICTED_DATA_CACHE = False
2019-10-18 14:18:49 +02:00
REST_FRAMEWORK = {"TEST_REQUEST_DEFAULT_FORMAT": "json"}