-
Notifications
You must be signed in to change notification settings - Fork 191
/
cms_helper.py
executable file
·145 lines (130 loc) · 3.4 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
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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function, unicode_literals
import os
from tempfile import mkdtemp
def gettext(s):
return s
HELPER_SETTINGS = dict(
ROOT_URLCONF='tests.test_utils.urls',
INSTALLED_APPS=[
'filer',
'parler',
'meta',
'easy_thumbnails',
'django.contrib.sitemaps',
'djangocms_text_ckeditor',
'cmsplugin_filer_image',
'taggit',
'taggit_autosuggest',
'aldryn_apphooks_config',
'aldryn_search',
],
LANGUAGE_CODE='en',
LANGUAGES=(
('en', gettext('English')),
('fr', gettext('French')),
('it', gettext('Italiano')),
),
CMS_LANGUAGES={
1: [
{
'code': 'en',
'name': gettext('English'),
'public': True,
},
{
'code': 'it',
'name': gettext('Italiano'),
'public': True,
},
{
'code': 'fr',
'name': gettext('French'),
'public': True,
},
],
2: [
{
'code': 'en',
'name': gettext('English'),
'public': True,
},
],
'default': {
'hide_untranslated': False,
},
},
PARLER_LANGUAGES={
1: (
{'code': 'en'},
{'code': 'it'},
{'code': 'fr'},
),
2: (
{'code': 'en'},
),
'default': {
'fallbacks': ['en'],
'hide_untranslated': False,
}
},
MIGRATION_MODULES={},
CMS_TEMPLATES=(
('blog.html', 'Blog template'),
),
META_SITE_PROTOCOL='http',
META_USE_SITES=True,
META_SITE_DOMAIN='example.com',
META_USE_OG_PROPERTIES=True,
META_USE_TWITTER_PROPERTIES=True,
META_USE_GOOGLEPLUS_PROPERTIES=True,
THUMBNAIL_PROCESSORS=(
'easy_thumbnails.processors.colorspace',
'easy_thumbnails.processors.autocrop',
'filer.thumbnail_processors.scale_and_crop_with_subject_location',
'easy_thumbnails.processors.filters',
),
USE_TZ=True,
TIME_ZONE='UTC',
FILE_UPLOAD_TEMP_DIR=mkdtemp(),
SITE_ID=1,
HAYSTACK_CONNECTIONS={
'default': {}
},
BLOG_AUTO_SETUP=False,
)
try:
import cmsplugin_filer_image.migrations_django # pragma: no cover # NOQA
HELPER_SETTINGS[
'MIGRATION_MODULES'
]['cmsplugin_filer_image'] = 'cmsplugin_filer_image.migrations_django'
except ImportError:
pass
try:
import admin_enhancer # pragma: no cover # NOQA
HELPER_SETTINGS['INSTALLED_APPS'].append('admin_enhancer')
except ImportError:
pass
try:
import meta_mixin # pragma: no cover # NOQA
HELPER_SETTINGS['INSTALLED_APPS'].append('meta_mixin')
except ImportError:
pass
try:
import knocker # pragma: no cover # NOQA
HELPER_SETTINGS['INSTALLED_APPS'].append('knocker')
HELPER_SETTINGS['CHANNEL_LAYERS'] = {
'default': {
'BACKEND': 'asgiref.inmemory.ChannelLayer',
'ROUTING': 'knocker.routing.channel_routing',
},
}
except ImportError:
pass
os.environ['AUTH_USER_MODEL'] = 'tests.test_utils.CustomUser'
def run():
from djangocms_helper import runner
runner.cms('djangocms_blog')
if __name__ == '__main__':
run()