djangocms_blog/cms_helper.py

104 lines
2.5 KiB
Python
Raw Normal View History

2015-01-04 16:59:20 +00:00
#!/usr/bin/env python
2014-08-13 06:42:03 +00:00
# -*- coding: utf-8 -*-
2015-01-04 16:59:20 +00:00
2014-09-03 06:45:25 +00:00
import sys
2014-08-13 06:42:03 +00:00
from tempfile import mkdtemp
gettext = lambda s: s
HELPER_SETTINGS = {
2014-09-03 06:45:25 +00:00
'NOSE_ARGS': [
'-s',
],
'ROOT_URLCONF': 'tests.test_utils.urls',
'INSTALLED_APPS': [
'admin_enhancer',
'filer',
'parler',
'taggit',
'meta',
'meta_mixin',
'easy_thumbnails',
'djangocms_text_ckeditor',
'cmsplugin_filer_image',
'taggit_autosuggest',
],
'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,
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
},
'PARLER_LANGUAGES': {
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': {
'fallback': 'en',
'hide_untranslated': False,
}
},
2014-10-11 07:05:02 +00:00
'MIDDLEWARE_CLASSES': [
'django.contrib.messages.middleware.MessageMiddleware',
],
2014-12-01 21:55:20 +00:00
'MIGRATION_MODULES': {
'cmsplugin_filer_image': 'cmsplugin_filer_image.migrations_django',
},
2014-09-03 06:45:25 +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': (
'easy_thumbnails.processors.colorspace',
'easy_thumbnails.processors.autocrop',
'filer.thumbnail_processors.scale_and_crop_with_subject_location',
'easy_thumbnails.processors.filters',
),
'FILE_UPLOAD_TEMP_DIR': mkdtemp(),
2014-10-04 18:05:17 +00:00
'SITE_ID': 1
2014-09-03 06:45:25 +00:00
}
if 'test' in sys.argv:
2014-12-01 21:55:20 +00:00
HELPER_SETTINGS['INSTALLED_APPS'].append('django_nose')
2015-01-01 17:51:45 +00:00
def run():
2015-01-04 16:59:20 +00:00
from djangocms_helper import runner
2015-01-04 17:17:25 +00:00
sys.argv.append('--nose-runner')
2015-01-04 16:59:20 +00:00
runner.cms('djangocms_blog')
if __name__ == "__main__":
run()