当前位置: 首页>>代码示例>>Python>>正文


Python Placeholder.slot方法代码示例

本文整理汇总了Python中cms.models.Placeholder.slot方法的典型用法代码示例。如果您正苦于以下问题:Python Placeholder.slot方法的具体用法?Python Placeholder.slot怎么用?Python Placeholder.slot使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在cms.models.Placeholder的用法示例。


在下文中一共展示了Placeholder.slot方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_render_placeholder_toolbar

# 需要导入模块: from cms.models import Placeholder [as 别名]
# 或者: from cms.models.Placeholder import slot [as 别名]
 def test_render_placeholder_toolbar(self):
     placeholder = Placeholder()
     placeholder.slot = "test"
     placeholder.pk = placeholder.id = 99
     context = SekizaiContext()
     context["request"] = AttributeObject(
         REQUEST={"language": "en"},
         GET=[],
         session={},
         path="/",
         user=self.test_user,
         current_page=None,
         method="GET",
     )
     classes = ["cms_placeholder-%s" % placeholder.pk, "cms_placeholder"]
     output = render_placeholder_toolbar(placeholder, context, "test", "en")
     for cls in classes:
         self.assertTrue(cls in output, "%r is not in %r" % (cls, output))
开发者ID:RicardoAndreSantos,项目名称:django-cms,代码行数:20,代码来源:rendering.py

示例2: test_render_placeholder_toolbar

# 需要导入模块: from cms.models import Placeholder [as 别名]
# 或者: from cms.models.Placeholder import slot [as 别名]
    def test_render_placeholder_toolbar(self):
        placeholder = Placeholder()
        placeholder.slot = 'test'
        placeholder.pk = placeholder.id = 99
        request = self.get_request(page=None)
        request.toolbar = CMSToolbar(request)

        content_renderer = self.get_content_renderer(request)

        context = SekizaiContext()
        context['request'] = request
        context['cms_content_renderer'] = content_renderer

        classes = [
            "cms-placeholder-%s" % placeholder.pk,
            'cms-placeholder',
        ]

        output = content_renderer.render_editable_placeholder(placeholder, context, 'en')
        for cls in classes:
            self.assertTrue(cls in output, '%r is not in %r' % (cls, output))
开发者ID:evildmp,项目名称:django-cms,代码行数:23,代码来源:test_rendering.py

示例3: test_render_placeholder_toolbar

# 需要导入模块: from cms.models import Placeholder [as 别名]
# 或者: from cms.models.Placeholder import slot [as 别名]
 def test_render_placeholder_toolbar(self):
     placeholder = Placeholder()
     placeholder.slot = 'test'
     placeholder.pk = placeholder.id = 99
     context = SekizaiContext()
     context['request'] = AttributeObject(
         REQUEST={'language': 'en'},
         GET=[],
         session={},
         path='/',
         user=self.test_user,
         current_page=None,
         method='GET',
     )
     classes = [
         "cms_placeholder-%s" % placeholder.pk,
         'cms_placeholder',
     ]
     output = render_placeholder_toolbar(placeholder, context, 'test', 'en')
     for cls in classes:
         self.assertTrue(cls in output, '%r is not in %r' % (cls, output))
开发者ID:alekGbuz,项目名称:django-cms,代码行数:23,代码来源:rendering.py


注:本文中的cms.models.Placeholder.slot方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。