Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
self.assertEqual(obj.render(), 'hello')
class PassthroughExtension(NavigationExtension):
# See PagesTestCase.test_23_navigation_extension
name = 'passthrough extension'
def children(self, page):
for p in page.children.in_navigation():
yield p
Page.register_extensions('datepublisher', 'navigation', 'seo', 'symlinks',
'titles', 'translations', 'seo')
Page.create_content_type(ContactFormContent, form=ContactForm)
Page.create_content_type(FileContent)
class PagesTestCase(TestCase):
def setUp(self):
u = User(username='test', is_active=True, is_staff=True, is_superuser=True)
u.set_password('test')
u.save()
Page.register_templates({
'key': 'base',
'title': 'Standard template',
'path': 'feincms_base.html',
'regions': (
('main', 'Main content area'),
('sidebar', 'Sidebar', 'inherited'),
),
self.assertEqual(obj.render(), 'hello')
class PassthroughExtension(NavigationExtension):
# See PagesTestCase.test_23_navigation_extension
name = 'passthrough extension'
def children(self, page):
for p in page.children.in_navigation():
yield p
Page.register_extensions('datepublisher', 'navigation', 'seo', 'symlinks',
'titles', 'translations', 'seo')
Page.create_content_type(ContactFormContent, form=ContactForm)
Page.create_content_type(FileContent)
class PagesTestCase(TestCase):
def setUp(self):
u = User(username='test', is_active=True, is_staff=True, is_superuser=True)
u.set_password('test')
u.save()
Page.register_templates({
'key': 'base',
'title': 'Standard template',
'path': 'feincms_base.html',
'regions': (
('main', 'Main content area'),
('sidebar', 'Sidebar', 'inherited'),
),
'title': 'Base Template',
'path': 'base.html',
'regions': (
('main', 'Main region'),
('sidebar', 'Sidebar', 'inherited'),
),
})
Page.create_content_type(RichTextContent)
Page.create_content_type(RawContent)
Page.create_content_type(
MediaFileContent,
TYPE_CHOICES=(
('default', 'Default position'),
),
)
Page.create_content_type(
ImageContent,
POSITION_CHOICES=(
('default', 'Default position'),
),
)
def get_admin_fields(form, *args, **kwargs):
return {
'exclusive_subpages': forms.BooleanField(
label=capfirst(_('exclusive subpages')),
required=False,
initial=form.instance.parameters.get('exclusive_subpages', False),
help_text=_(
'Exclude everything other than the application\'s'
' content when rendering subpages.'),
from feincms.module.page.extensions.navigation import (
NavigationExtension, PagePretender)
from feincms.content.application.models import app_reverse
Page.register_templates({
'key': 'base',
'title': 'Base Template',
'path': 'base.html',
'regions': (
('main', 'Main region'),
('sidebar', 'Sidebar', 'inherited'),
),
})
Page.create_content_type(RichTextContent)
Page.create_content_type(RawContent)
Page.create_content_type(
MediaFileContent,
TYPE_CHOICES=(
('default', 'Default position'),
),
)
Page.create_content_type(
ImageContent,
POSITION_CHOICES=(
('default', 'Default position'),
),
)
def get_admin_fields(form, *args, **kwargs):
return {
'title': _(u"Base template"),
'path': 'page/base.html',
'key': 'page_base',
'regions': (
('main', _(u"Main")),
('sidebar', _(u"Sidebar")),
)
},
)
# Standard content types
Page.create_content_type(RawContent)
Page.create_content_type(RichTextContent)
# Register the ``django-fobi`` widget.
Page.create_content_type(FobiFormWidget)
'path': 'feincms_moodboard.html',
'regions': (
('main', _('Main content area')),
('moodboard', _('Moodboard'), 'inherited'),
),
})
Page.register_extensions(
'feincms.module.page.extensions.titles',
'feincms.module.page.extensions.navigation',
'feincms.module.extensions.seo',
'feincms.module.extensions.changedate',
'feincms.module.extensions.ct_tracker',
)
Page.create_content_type(ApplicationContent, APPLICATIONS=(
('zipfelchappe.urls', _('Zipfelchappe projects')),
))
Page.create_content_type(RichTextContent)
Page.create_content_type(MediaFileContent, TYPE_CHOICES=MEDIA_TYPE_CHOICES)
Page.create_content_type(ProjectTeaserContent)
Page.create_content_type(RawContent)
Project.register_regions(
('main', _('Content')),
('updates', _('Updates')),
)
Project.register_extensions(
#'zipfelchappe.extensions.categories',
def get_admin_fields(form, *args, **kwargs):
return {
'exclusive_subpages': forms.BooleanField(
label=capfirst(_('exclusive subpages')),
required=False,
initial=form.instance.parameters.get('exclusive_subpages', False),
help_text=_(
'Exclude everything other than the application\'s'
' content when rendering subpages.'),
),
}
Page.create_content_type(ApplicationContent, APPLICATIONS=(
('blog_urls', 'Blog', {
'admin_fields': get_admin_fields,
'urls': 'example.blog_urls',
}),
))
Entry.register_regions(
('main', 'Main region'),
)
Entry.create_content_type(RawContent)
Entry.create_content_type(
ImageContent,
POSITION_CHOICES=(
('default', 'Default position'),
)