-
Notifications
You must be signed in to change notification settings - Fork 3
/
test_settings.py
76 lines (63 loc) · 2.12 KB
/
test_settings.py
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
# -*- coding: utf-8 -*-
from __future__ import unicode_literals, absolute_import
import os
DEBUG = os.environ.get('DEBUG', 'on') == 'on'
SECRET_KEY = os.environ.get('SECRET_KEY', 'TESTTESTTESTTESTTESTTESTTESTTEST')
ALLOWED_HOSTS = os.environ.get('ALLOWED_HOSTS', 'localhost,testserver,*').split(',')
BASE_DIR = os.path.abspath(os.path.dirname(os.path.abspath(__file__)))
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
}
}
INSTALLED_APPS = [
'django.contrib.sessions',
'django.contrib.contenttypes',
'django.contrib.admin',
'django.contrib.staticfiles',
'django.contrib.auth',
'intercoolerjs',
'intercooler_helpers',
]
SKIP_SOUTH_TESTS = True
SOUTH_TESTS_MIGRATE = False
STATIC_URL = '/__static__/'
MEDIA_URL = '/__media__/'
MESSAGE_STORAGE = 'django.contrib.messages.storage.cookie.CookieStorage'
SESSION_ENGINE = 'django.contrib.sessions.backends.signed_cookies'
SESSION_COOKIE_HTTPONLY = True
ROOT_URLCONF = 'test_urls'
# Use a fast hasher to speed up tests.
PASSWORD_HASHERS = (
'django.contrib.auth.hashers.MD5PasswordHasher',
)
SITE_ID = 1
TEMPLATE_CONTEXT_PROCESSORS = (
'django.contrib.auth.context_processors.auth',
)
TEMPLATE_LOADERS = (
'django.template.loaders.filesystem.Loader',
)
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [os.path.join(BASE_DIR, "test_templates")],
'OPTIONS': {
'context_processors': TEMPLATE_CONTEXT_PROCESSORS,
'loaders': TEMPLATE_LOADERS,
},
},
]
MIDDLEWARE_CLASSES = (
'django.contrib.sessions.middleware.SessionMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'intercooler_helpers.middleware.HttpMethodOverride',
'intercooler_helpers.middleware.IntercoolerData',
'intercooler_helpers.middleware.IntercoolerRedirector',
)
STATIC_ROOT = os.path.join(BASE_DIR, 'test_collectstatic')
MEDIA_ROOT = os.path.join(BASE_DIR, 'test_media')
USE_TZ = True
SILENCED_SYSTEM_CHECKS = ['1_8.W001']