2015-01-04 16:59:20 +00:00
|
|
|
#!/usr/bin/env python
|
2014-08-13 06:42:03 +00:00
|
|
|
# -*- coding: utf-8 -*-
|
2015-09-12 22:46:05 +00:00
|
|
|
from __future__ import absolute_import, print_function, unicode_literals
|
|
|
|
|
2016-05-11 15:22:12 +00:00
|
|
|
import os
|
|
|
|
|
2014-08-13 06:42:03 +00:00
|
|
|
from tempfile import mkdtemp
|
2015-07-18 16:32:24 +00:00
|
|
|
|
2016-01-18 22:48:43 +00:00
|
|
|
|
|
|
|
def gettext(s): return s
|
2014-08-13 06:42:03 +00:00
|
|
|
|
2015-07-18 16:32:24 +00:00
|
|
|
HELPER_SETTINGS = dict(
|
|
|
|
ROOT_URLCONF='tests.test_utils.urls',
|
|
|
|
INSTALLED_APPS=[
|
2014-09-03 06:45:25 +00:00
|
|
|
'filer',
|
|
|
|
'parler',
|
|
|
|
'meta',
|
|
|
|
'easy_thumbnails',
|
2015-10-31 00:19:47 +00:00
|
|
|
'django.contrib.sitemaps',
|
2014-09-03 06:45:25 +00:00
|
|
|
'djangocms_text_ckeditor',
|
|
|
|
'cmsplugin_filer_image',
|
2015-07-19 07:37:26 +00:00
|
|
|
'taggit',
|
2014-09-03 06:45:25 +00:00
|
|
|
'taggit_autosuggest',
|
2015-09-19 23:11:14 +00:00
|
|
|
'aldryn_apphooks_config',
|
2015-10-15 15:47:12 +00:00
|
|
|
'aldryn_search',
|
2014-09-03 06:45:25 +00:00
|
|
|
],
|
2015-07-18 16:32:24 +00:00
|
|
|
LANGUAGE_CODE='en',
|
|
|
|
LANGUAGES=(
|
2014-09-03 06:45:25 +00:00
|
|
|
('en', gettext('English')),
|
|
|
|
('fr', gettext('French')),
|
|
|
|
('it', gettext('Italiano')),
|
|
|
|
),
|
2015-07-18 16:32:24 +00:00
|
|
|
CMS_LANGUAGES={
|
2014-09-03 06:45:25 +00:00
|
|
|
1: [
|
|
|
|
{
|
|
|
|
'code': 'en',
|
|
|
|
'name': gettext('English'),
|
|
|
|
'public': True,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
'code': 'it',
|
|
|
|
'name': gettext('Italiano'),
|
|
|
|
'public': True,
|
2014-08-13 06:42:03 +00:00
|
|
|
},
|
2014-09-03 06:45:25 +00:00
|
|
|
{
|
|
|
|
'code': 'fr',
|
|
|
|
'name': gettext('French'),
|
|
|
|
'public': True,
|
|
|
|
},
|
|
|
|
],
|
2014-10-04 17:22:22 +00:00
|
|
|
2: [
|
|
|
|
{
|
|
|
|
'code': 'en',
|
|
|
|
'name': gettext('English'),
|
|
|
|
'public': True,
|
|
|
|
},
|
|
|
|
],
|
2014-09-03 06:45:25 +00:00
|
|
|
'default': {
|
|
|
|
'hide_untranslated': False,
|
2014-08-13 06:42:03 +00:00
|
|
|
},
|
2014-09-03 06:45:25 +00:00
|
|
|
},
|
2015-07-18 16:32:24 +00:00
|
|
|
PARLER_LANGUAGES={
|
2014-09-03 06:45:25 +00:00
|
|
|
1: (
|
|
|
|
{'code': 'en'},
|
|
|
|
{'code': 'it'},
|
|
|
|
{'code': 'fr'},
|
2014-08-13 06:42:03 +00:00
|
|
|
),
|
2014-10-04 17:22:22 +00:00
|
|
|
2: (
|
|
|
|
{'code': 'en'},
|
|
|
|
),
|
2014-09-03 06:45:25 +00:00
|
|
|
'default': {
|
2016-02-07 11:16:24 +00:00
|
|
|
'fallbacks': ['en'],
|
2014-09-03 06:45:25 +00:00
|
|
|
'hide_untranslated': False,
|
|
|
|
}
|
|
|
|
},
|
2016-03-19 13:11:10 +00:00
|
|
|
MIGRATION_MODULES={},
|
2015-10-18 10:46:50 +00:00
|
|
|
CMS_TEMPLATES=(
|
|
|
|
('blog.html', 'Blog template'),
|
|
|
|
),
|
2015-07-18 16:32:24 +00:00
|
|
|
META_SITE_PROTOCOL='http',
|
|
|
|
META_SITE_DOMAIN='example.com',
|
|
|
|
META_USE_OG_PROPERTIES=True,
|
|
|
|
META_USE_TWITTER_PROPERTIES=True,
|
|
|
|
META_USE_GOOGLEPLUS_PROPERTIES=True,
|
|
|
|
THUMBNAIL_PROCESSORS=(
|
2014-09-03 06:45:25 +00:00
|
|
|
'easy_thumbnails.processors.colorspace',
|
|
|
|
'easy_thumbnails.processors.autocrop',
|
|
|
|
'filer.thumbnail_processors.scale_and_crop_with_subject_location',
|
|
|
|
'easy_thumbnails.processors.filters',
|
|
|
|
),
|
2016-05-25 22:52:09 +00:00
|
|
|
USE_TZ=True,
|
|
|
|
TIME_ZONE='UTC',
|
2015-07-18 16:32:24 +00:00
|
|
|
FILE_UPLOAD_TEMP_DIR=mkdtemp(),
|
2015-10-15 20:29:32 +00:00
|
|
|
SITE_ID=1,
|
2016-01-18 22:48:43 +00:00
|
|
|
HAYSTACK_CONNECTIONS={
|
2016-04-08 14:17:47 +00:00
|
|
|
'default': {}
|
2016-05-11 15:22:12 +00:00
|
|
|
},
|
2015-07-18 16:32:24 +00:00
|
|
|
)
|
2015-01-01 17:51:45 +00:00
|
|
|
|
2016-03-19 13:11:10 +00:00
|
|
|
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
|
|
|
|
|
2015-07-19 07:37:26 +00:00
|
|
|
try:
|
2015-07-19 08:36:52 +00:00
|
|
|
import admin_enhancer # pragma: no cover # NOQA
|
2015-07-19 07:37:26 +00:00
|
|
|
HELPER_SETTINGS['INSTALLED_APPS'].append('admin_enhancer')
|
|
|
|
except ImportError:
|
|
|
|
pass
|
|
|
|
|
2016-03-27 17:25:01 +00:00
|
|
|
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
|
2016-05-11 15:22:12 +00:00
|
|
|
os.environ['AUTH_USER_MODEL'] = 'tests.test_utils.CustomUser'
|
2016-03-27 17:25:01 +00:00
|
|
|
|
2015-01-01 17:51:45 +00:00
|
|
|
|
|
|
|
def run():
|
2015-01-04 16:59:20 +00:00
|
|
|
from djangocms_helper import runner
|
|
|
|
runner.cms('djangocms_blog')
|
|
|
|
|
2016-04-08 14:17:47 +00:00
|
|
|
if __name__ == '__main__':
|
2015-07-18 16:32:24 +00:00
|
|
|
run()
|