summaryrefslogtreecommitdiffstats
path: root/tests_multitenant/settings.py
blob: 20af7a76b61eb321d47c88feab04a0ee330d501e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
import os.path
import __builtin__ as builtin
from mock import mock_open, patch

LANGUAGE_CODE = 'en-us'

INSTALLED_APPS = ('django.contrib.auth', 'django.contrib.sessions', 'django.contrib.contenttypes',
                  'mellon', 'hobo.environment', 'hobo.profile')

PROJECT_NAME = 'fake-agent'

MIDDLEWARE_CLASSES = (
    'django.contrib.sessions.middleware.SessionMiddleware',
    'django.middleware.locale.LocaleMiddleware',
    'django.middleware.common.CommonMiddleware',
    'django.middleware.csrf.CsrfViewMiddleware',
    'django.contrib.auth.middleware.AuthenticationMiddleware',
    'django.contrib.messages.middleware.MessageMiddleware',
    'django.middleware.clickjacking.XFrameOptionsMiddleware',
)

TEMPLATES = [
    {
        'BACKEND': 'django.template.backends.django.DjangoTemplates',
        'DIRS': [
        ],
        'APP_DIRS': True,
        'OPTIONS': {
            'context_processors': [
                'django.contrib.auth.context_processors.auth',
                'django.template.context_processors.debug',
                'django.template.context_processors.i18n',
                'django.template.context_processors.media',
                'django.template.context_processors.static',
                'django.template.context_processors.tz',
                'django.contrib.messages.context_processors.messages',
            ],
        },
    },
]


with patch.object(builtin, 'file', mock_open(read_data='xxx')):
    execfile(os.path.join(os.path.dirname(__file__), '../debian/debian_config_common.py'))

BRANCH_NAME = os.environ.get("BRANCH_NAME", "").replace('/', '-')
DATABASES['default']['TEST'] = {
    'NAME': DATABASES['default']['NAME'] + '-%s' % BRANCH_NAME,
}

TENANT_APPS = ('django.contrib.auth', 'django.contrib.sessions', 'django.contrib.contenttypes',
               'hobo.agent.common', 'mellon')

ROOT_URLCONF = 'hobo.agent.test_urls'
CACHES = {
    'default': {
        'BACKEND': 'hobo.multitenant.cache.TenantCache',
        'REAL_BACKEND': 'django.core.cache.backends.locmem.LocMemCache',
    }
}
STATIC_URL = '/static/'

MELLON_IDENTITY_PROVIDERS = []
LOGGING = None

UPDATE_ME = {'x': 1}
EXTEND_ME = [1]

THEMES_DIRECTORY = os.path.join(os.path.dirname(__file__), 'files')

TENANT_SETTINGS_LOADERS = (
        'hobo.multitenant.settings_loaders.TemplateVars',
        'hobo.multitenant.settings_loaders.KnownServices',
        'hobo.multitenant.settings_loaders.CORSSettings',
        'hobo.multitenant.settings_loaders.SharedThemeSettings',
        'hobo.multitenant.settings_loaders.Mellon',
        'hobo.multitenant.settings_loaders.SiteBaseUrl',
        'hobo.multitenant.settings_loaders.CookieNames',
        'hobo.multitenant.settings_loaders.SettingsJSON',
        'hobo.multitenant.settings_loaders.SettingsVars',
)

GLOBAL1 = 0
GLOBAL2 = [1, 2, 3]
GLOBAL3 = {"z": 1}

OVERRIDE1 = 0
OVERRIDE2 = [1, 2, 3]
OVERRIDE3 = {"z": 1}