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
|
import os
TEST_DIR = os.path.join(os.path.abspath(os.path.dirname(__file__)), "tests")
CACHES = {
"default": {
"BACKEND": "django.core.cache.backends.locmem.LocMemCache",
"LOCATION": "unique-snowflake",
}
}
DATABASES = {
"default": {
"ENGINE": "django.db.backends.sqlite3",
"NAME": ":memory:",
}
}
INSTALLED_APPS = [
"django.contrib.staticfiles",
"compressor",
"sekizai",
]
STATICFILES_FINDERS = [
"django.contrib.staticfiles.finders.FileSystemFinder",
"django.contrib.staticfiles.finders.AppDirectoriesFinder",
"compressor.finders.CompressorFinder",
]
STATIC_URL = "/static/"
STATIC_ROOT = os.path.join(TEST_DIR, "static")
TEMPLATES = [
{
"BACKEND": "django.template.backends.django.DjangoTemplates",
"APP_DIRS": True,
"DIRS": [
# Specifically choose a name that will not be considered
# by app_directories loader, to make sure each test uses
# a specific template without considering the others.
os.path.join(TEST_DIR, "test_templates"),
],
},
{
"BACKEND": "django.template.backends.jinja2.Jinja2",
"APP_DIRS": True,
"DIRS": [
# Specifically choose a name that will not be considered
# by app_directories loader, to make sure each test uses
# a specific template without considering the others.
os.path.join(TEST_DIR, "test_templates_jinja2"),
],
},
]
SECRET_KEY = "iufoj=mibkpdz*%bob952x(%49rqgv8gg45k36kjcg76&-y5=!"
PASSWORD_HASHERS = ("django.contrib.auth.hashers.UnsaltedMD5PasswordHasher",)
MIDDLEWARE_CLASSES = []
USE_TZ = True
|