OpenSlides/tests/settings.py

95 lines
2.0 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
EMAIL_BACKEND = 'django.core.mail.backends.locmem.EmailBackend'
# OpenSlides plugins
# Add plugins to this list.
2016-06-16 10:59:35 +02:00
INSTALLED_PLUGINS += ( # noqa
2016-02-16 22:51:38 +01:00
'tests.integration.test_plugin',
)
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/
SECRET_KEY = 'secret'
DEBUG = False
# Database
# https://docs.djangoproject.com/en/1.10/ref/settings/#databases
# Change this setting to use e. g. PostgreSQL or MySQL.
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
}
}
# Configure session in the cache
CACHES = {
'default': {
'BACKEND': 'django.core.cache.backends.locmem.LocMemCache',
}
}
SESSION_ENGINE = "django.contrib.sessions.backends.cache"
# When use_redis is True, the restricted data cache caches the data individuel
# for each user. This requires a lot of memory if there are a lot of active
# users. If use_redis is False, this setting has no effect.
DISABLE_USER_CACHE = False
# Internationalization
# https://docs.djangoproject.com/en/1.10/topics/i18n/
TIME_ZONE = 'Europe/Berlin'
# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/1.10/howto/static-files/
2016-06-16 10:59:35 +02:00
STATICFILES_DIRS.insert(0, os.path.join(OPENSLIDES_USER_DATA_PATH, 'static')) # noqa
# Files
# https://docs.djangoproject.com/en/1.10/topics/files/
MEDIA_ROOT = os.path.join(OPENSLIDES_USER_DATA_PATH, '')
# Customization of OpenSlides apps
MOTION_IDENTIFIER_MIN_DIGITS = 1
# Special settings only for testing
# Use a faster password hasher.
PASSWORD_HASHERS = [
2013-10-31 09:43:19 +01:00
'django.contrib.auth.hashers.MD5PasswordHasher',
]
# At least in Django 2.1 and Channels 2.1 the django transactions can not be shared between
# threads. So we have to skip the asyncio-cache.
SKIP_CACHE = True