hobo/tests_authentic/settings.py

42 lines
1.1 KiB
Python

import os.path
import __builtin__ as builtin
from mock import mock_open, patch
import os
# Debian defaults
DEBUG = False
PROJECT_NAME = 'authentic2-multitenant'
with patch.object(builtin, 'file', mock_open(read_data='xxx')):
execfile(os.environ['DEBIAN_CONFIG_COMMON'])
BRANCH_NAME = os.environ.get("BRANCH_NAME", "").replace('/', '-')
DATABASES['default']['TEST'] = {
'NAME': DATABASES['default']['NAME'] + '-%s' % BRANCH_NAME,
}
# Avoid conflic with real tenants
# that might exist in /var/lib/authentic2_multitenant/tenants
TENANT_BASE = '/that/path/does/not/exist'
# Add the XForwardedForMiddleware
MIDDLEWARE_CLASSES = ('authentic2.middleware.XForwardedForMiddleware',) + MIDDLEWARE_CLASSES
# Add authentic settings loader
TENANT_SETTINGS_LOADERS = ('hobo.multitenant.settings_loaders.Authentic',) + TENANT_SETTINGS_LOADERS
# Add authentic2 hobo agent
INSTALLED_APPS = ('hobo.agent.authentic2',) + INSTALLED_APPS
CACHES = {
'default': {
'BACKEND': 'hobo.multitenant.cache.TenantCache',
'REAL_BACKEND': 'django.core.cache.backends.locmem.LocMemCache',
}
}
HOBO_ROLE_EXPORT = True