-
Notifications
You must be signed in to change notification settings - Fork 14
/
test_settings.py
92 lines (81 loc) · 2.69 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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
import os
from djangocms_url_manager.test_utils.polls.utils import (
get_all_poll_content_objects,
get_published_pages_objects,
)
EXTRA_INSTALLED_APPS = ["app_helper"]
ENABLE_VERSIONING = bool(os.environ.get("ENABLE_VERSIONING", True))
if ENABLE_VERSIONING:
EXTRA_INSTALLED_APPS.append("djangocms_versioning")
ENABLE_NAVIGATION = bool(os.environ.get("ENABLE_NAVIGATION", False))
if ENABLE_NAVIGATION:
EXTRA_INSTALLED_APPS.append("djangocms_navigation")
ENABLE_MODERATION = bool(os.environ.get("ENABLE_MODERATION", True))
if ENABLE_MODERATION:
EXTRA_INSTALLED_APPS.append("djangocms_moderation")
HELPER_SETTINGS = {
"SECRET_KEY": "djangocmsurlmanagertestsuitekey",
"VERSIONING_CMS_MODELS_ENABLED": ENABLE_VERSIONING,
"VERSIONING_URL_MANAGER_MODELS_ENABLED": ENABLE_VERSIONING,
"MODERATING_URL_MANAGER_MODELS_ENABLED": ENABLE_MODERATION,
"CMS_CONFIRM_VERSION4": True,
"TOP_INSTALLED_APPS": ["djangocms_url_manager"],
"INSTALLED_APPS": [
"djangocms_url_manager.test_utils.polls",
"djangocms_url_manager.test_utils.text",
]
+ EXTRA_INSTALLED_APPS,
"MIGRATION_MODULES": {
"sites": None,
"contenttypes": None,
"auth": None,
"cms": None,
"menus": None,
"polls": None,
"text": None,
"djangocms_url_manager": None,
"djangocms_versioning": None,
"djangocms_navigation": None,
"djangocms_moderation": None,
},
"CMS_PERMISSION": True,
# At present, testing requires bootstrap to be disabled.
# 'ALDRYN_BOILERPLATE_NAME': 'bootstrap3',
"LANGUAGES": (
("en", "English"),
("de", "German"),
("fr", "French"),
("it", "Italiano"),
),
"CMS_LANGUAGES": {
1: [
{"code": "en", "name": "English", "fallbacks": ["de", "fr"]},
{
"code": "de",
"name": "Deutsche",
"fallbacks": ["en"], # FOR TESTING DO NOT ADD 'fr' HERE
},
{
"code": "fr",
"name": "Française",
"fallbacks": ["en"], # FOR TESTING DO NOT ADD 'de' HERE
},
{
"code": "it",
"name": "Italiano",
"fallbacks": ["fr"], # FOR TESTING, LEAVE AS ONLY 'fr'
},
]
},
"LANGUAGE_CODE": "en",
"URL_MANAGER_SUPPORTED_MODELS": [
("cms.Page", get_published_pages_objects),
("polls.PollContent", get_all_poll_content_objects),
],
"DEFAULT_AUTO_FIELD": "django.db.models.AutoField",
}
def run():
from app_helper import runner
runner.cms("djangocms_url_manager", extra_args=[])
if __name__ == "__main__":
run()