示例#1
0
 def test_placeholder_name_toolbar(self):
     placeholder_conf_name = 'test_placeholder'
     placeholder_conf_tag = '<div class="cms_placeholder-title">%s</div>' % placeholder_conf_name
     with SettingsOverride(CMS_PLACEHOLDER_CONF = {
                               'test': {'name':placeholder_conf_name}
                           }):
         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-bar-%s" % placeholder.pk,
             "cms_placeholder_slot::test",
             ]
         output = render_placeholder_toolbar(placeholder, context, '', 'test')
         self.assertTrue(placeholder_conf_tag in output, 'placeholder name %r is not in %r' % (placeholder_conf_name, output))
示例#2
0
 def test_placeholder_name_toolbar(self):
     placeholder_conf_name = 'test_placeholder'
     placeholder_conf_tag = '<div class="cms_placeholder-title">%s</div>' % placeholder_conf_name
     with SettingsOverride(
             CMS_PLACEHOLDER_CONF={'test': {
                 'name': placeholder_conf_name
             }}):
         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-bar-%s" % placeholder.pk,
             "cms_placeholder_slot::test",
         ]
         output = render_placeholder_toolbar(placeholder, context, '',
                                             'test')
         self.assertTrue(
             placeholder_conf_tag in output,
             'placeholder name %r is not in %r' %
             (placeholder_conf_name, output))
示例#3
0
 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-bar-%s" % placeholder.pk, "cms_placeholder_slot::test"]
     output = render_placeholder_toolbar(placeholder, context, "", "test")
     for cls in classes:
         self.assertTrue(cls in output, "%r is not in %r" % (cls, output))
示例#4
0
 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-bar-%s" % placeholder.pk,
         "cms_placeholder_slot::test",
     ]
     output = render_placeholder_toolbar(placeholder, context, '', 'test')
     for cls in classes:
         self.assertTrue(cls in output, '%r is not in %r' % (cls, output))
示例#5
0
 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))