-
Notifications
You must be signed in to change notification settings - Fork 8
/
cms_helper.py
executable file
·66 lines (54 loc) · 1.36 KB
/
cms_helper.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
#!/usr/bin/env python
from tempfile import mkdtemp
HELPER_SETTINGS = dict(
ROOT_URLCONF="tests.example_app.urls",
INSTALLED_APPS=[
"daphne",
"channels",
"sekizai",
"meta",
"tests.example_app",
],
LANGUAGES=(
("en", "English"),
("fr", "French"),
("it", "Italiano"),
),
PARLER_LANGUAGES={
1: (
{"code": "en"},
{"code": "it"},
{"code": "fr"},
),
2: ({"code": "en"},),
"default": {
"fallbacks": ["en"],
"hide_untranslated": False,
},
},
META_USE_SITES=True,
FILE_UPLOAD_TEMP_DIR=mkdtemp(),
META_SITE_PROTOCOL="http",
ASGI_APPLICATION="tests.example_app.routing.application",
TEST_RUNNER="app_helper.pytest_runner.PytestTestRunner",
CHANNEL_LAYERS={
"default": {
"BACKEND": "channels_redis.core.RedisChannelLayer",
"CONFIG": {
"hosts": [("localhost", 6379)],
},
},
},
)
def run():
from app_helper import runner
runner.run("knocker")
def setup():
import sys
from app_helper import runner
runner.setup("knocker", sys.modules[__name__], use_cms=False)
if __name__ == "__main__":
run()
if __name__ == "cms_helper":
# this is needed to run cms_helper in pycharm
setup()