forked from django-cms/djangocms-text-ckeditor
-
Notifications
You must be signed in to change notification settings - Fork 1
/
test_settings.py
118 lines (107 loc) · 3.14 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
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
# -*- coding: utf-8 -*-
from tempfile import mkdtemp
import sys
def gettext(s):
return s
class DisableMigrations(dict):
def __contains__(self, item):
return True
def __getitem__(self, item):
from distutils.version import LooseVersion
import django
DJANGO_1_9 = LooseVersion(django.get_version()) < LooseVersion('1.10')
if DJANGO_1_9:
return 'notmigrations'
else:
return None
HELPER_SETTINGS = {
'INSTALLED_APPS': [
'easy_thumbnails',
'filer',
'mptt',
'djangocms_picture',
'djangocms_link',
],
'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,
},
],
'default': {
'hide_untranslated': False,
},
},
'CMS_PERMISSION': False,
'CMS_PLACEHOLDER_CONF': {
'content': {
'plugins': ['TextPlugin', 'PicturePlugin'],
'text_only_plugins': ['LinkPlugin'],
'extra_context': {'width': 640},
'name': gettext('Content'),
'language_fallback': True,
'default_plugins': [
{
'plugin_type': 'TextPlugin',
'values': {
'body': '<p>Lorem ipsum dolor sit amet...</p>',
},
},
],
'child_classes': {
'TextPlugin': ['PicturePlugin', 'LinkPlugin'],
},
'parent_classes': {
'LinkPlugin': ['TextPlugin'],
},
'plugin_modules': {
'LinkPlugin': 'Extra',
},
'plugin_labels': {
'LinkPlugin': 'Add a link',
}
},
},
'FILE_UPLOAD_TEMP_DIR': mkdtemp(),
'SITE_ID': 1,
'THUMBNAIL_PROCESSORS': (
'easy_thumbnails.processors.colorspace',
'easy_thumbnails.processors.autocrop',
'filer.thumbnail_processors.scale_and_crop_with_subject_location',
'easy_thumbnails.processors.filters',
),
'CMS_TEMPLATES': (
('page.html', 'Normal page'),
('plugin_with_sekizai.html', 'Plugin with sekizai'),
),
'DJANGOCMS_TRANSLATIONS_CONF': {
'Bootstrap3ButtonCMSPlugin': {'text_field_child_label': 'label'},
'DummyLinkPlugin': {'text_field_child_label': 'label'},
},
}
if 'test' in sys.argv:
HELPER_SETTINGS['MIGRATION_MODULES'] = DisableMigrations()
HELPER_SETTINGS['INSTALLED_APPS'].append('djangocms_text_ckeditor.test_app')
def run():
from djangocms_helper import runner
runner.cms('djangocms_text_ckeditor')
if __name__ == '__main__':
run()