cd34d30866
* Activate restricted_data_cache on inmemory cache * Use ElementCache in rest-api get requests * Get requests on the restapi return 404 when the user has no permission * Added async function for has_perm and in_some_groups * changed Cachable.get_restricted_data to be an ansync function * rewrote required_user_system * changed default implementation of access_permission.check_permission to check a given permission or check if anonymous is enabled
81 lines
1.6 KiB
Python
81 lines
1.6 KiB
Python
"""
|
|
Settings file for OpenSlides' tests.
|
|
"""
|
|
|
|
import os
|
|
|
|
from openslides.global_settings import * # noqa
|
|
|
|
|
|
# Path to the directory for user specific data files
|
|
|
|
OPENSLIDES_USER_DATA_PATH = os.path.realpath(os.path.dirname(os.path.abspath(__file__)))
|
|
|
|
EMAIL_BACKEND = 'django.core.mail.backends.locmem.EmailBackend'
|
|
|
|
# OpenSlides plugins
|
|
|
|
# Add plugins to this list.
|
|
|
|
INSTALLED_PLUGINS += ( # noqa
|
|
'tests.integration.test_plugin',
|
|
)
|
|
|
|
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',
|
|
}
|
|
}
|
|
|
|
SESSION_ENGINE = "django.contrib.sessions.backends.cache"
|
|
|
|
# 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/
|
|
|
|
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 = [
|
|
'django.contrib.auth.hashers.MD5PasswordHasher',
|
|
]
|
|
|
|
# Deactivate restricted_data_cache
|
|
RESTRICTED_DATA_CACHE = False
|