Esempio n. 1
0
 def test_diazo_snippets_viewlet_render(self):
     """Validate that the diazo snippet viewlet renders correctly."""
     dsv = DiazoSnippetViewlet(self.portal, self.request, None)
     dsv.update()
     rendered = dsv.render()
     try:
         self.assertIn('spirit_plone_theming_diazo_snippets', rendered)
     except AttributeError:
         self.assertTrue('spirit_plone_theming_diazo_snippets' in rendered)
Esempio n. 2
0
 def test_diazo_snippet_debug(self):
     """Validate the 'debug' attribute."""
     dsv = DiazoSnippetViewlet(self.portal, self.request, None)
     dsv.update()
     rendered = dsv.render()
     self.assertFalse(dsv.debug)
     try:
         self.assertNotIn('PLONE_THEMING_DEBUG', rendered)
     except AttributeError:
         self.assertFalse('PLONE_THEMING_DEBUG' in rendered)
Esempio n. 3
0
 def test_diazo_snippet_rapido_available(self):
     """Validate the 'rapido_available' attribute."""
     dsv = DiazoSnippetViewlet(self.portal, self.request, None)
     dsv.update()
     rendered = dsv.render()
     self.assertFalse(dsv.rapido_available)
     try:
         self.assertNotIn('PLONE_THEMING_RAPIDO_AVAILABLE', rendered)
     except AttributeError:
         self.assertFalse('PLONE_THEMING_RAPIDO_AVAILABLE' in rendered)
Esempio n. 4
0
 def test_diazo_snippet_hide_colophon(self):
     """Validate the 'hide_colophon' attribute."""
     dsv = DiazoSnippetViewlet(self.portal, self.request, None)
     dsv.update()
     rendered = dsv.render()
     self.assertFalse(dsv.hide_colophon)
     try:
         self.assertNotIn('PLONE_THEMING_HIDE_COLOPHON', rendered)
     except AttributeError:
         self.assertFalse('PLONE_THEMING_HIDE_COLOPHON' in rendered)
Esempio n. 5
0
 def test_diazo_snippets_debug_style(self):
     """Validate that the diazo snippet viewlet applies correct CSS."""
     dsv = DiazoSnippetViewlet(self.portal, self.request, None)
     dsv.update()
     rendered = dsv.render()
     self.assertEqual(dsv.debug_style, 'none')
     try:
         self.assertIn('style="display: none"', rendered)
     except AttributeError:
         self.assertTrue('style="display: none"' in rendered)
Esempio n. 6
0
 def test_diazo_snippet_hide_searchbox(self):
     """Validate the 'hide_searchbox' attribute."""
     dsv = DiazoSnippetViewlet(self.portal, self.request, None)
     dsv.update()
     rendered = dsv.render()
     self.assertFalse(dsv.hide_searchbox)
     try:
         self.assertNotIn('PLONE_THEMING_HIDE_SEARCHBOX', rendered)
     except AttributeError:
         self.assertFalse('PLONE_THEMING_HIDE_SEARCHBOX' in rendered)
Esempio n. 7
0
 def test_diazo_snippet_plone_version(self):
     """Validate the 'plone_version' attribute."""
     dsv = DiazoSnippetViewlet(self.portal, self.request, None)
     dsv.update()
     rendered = dsv.render()
     version = ploneapi.env.plone_version()[:1]
     self.assertEqual(dsv.plone_version, version)
     snippet_id = '_'.join(['PLONE_THEMING_PLONE_VERSION', version])
     try:
         self.assertIn(snippet_id, rendered)
     except AttributeError:
         self.assertTrue(snippet_id in rendered)
Esempio n. 8
0
 def test_diazo_debug_set(self):
     """Validate the 'debug' attribute."""
     dsv = DiazoSnippetViewlet(self.portal, self.request, None)
     dsv.update()
     ploneapi.portal.set_registry_record(
         name='debug',
         value=True,
         interface=IPloneThemeSettings,
     )
     rendered = dsv.render()
     self.assertTrue(dsv.debug)
     try:
         self.assertIn('PLONE_THEMING_DEBUG', rendered)
     except AttributeError:
         self.assertTrue('PLONE_THEMING_DEBUG' in rendered)
Esempio n. 9
0
 def test_diazo_snippets_debug_style_set(self):
     """Validate that the diazo snippet viewlet applies correct CSS."""
     dsv = DiazoSnippetViewlet(self.portal, self.request, None)
     dsv.update()
     ploneapi.portal.set_registry_record(
         name='debug',
         value=True,
         interface=IPloneThemeSettings,
     )
     rendered = dsv.render()
     self.assertEqual(dsv.debug_style, 'block')
     try:
         self.assertIn('style="display: block"', rendered)
     except AttributeError:
         self.assertTrue('style="display: block"' in rendered)
Esempio n. 10
0
 def test_diazo_snippet_themefragments_available(self):
     """Validate the 'themefragments_available' attribute."""
     dsv = DiazoSnippetViewlet(self.portal, self.request, None)
     dsv.update()
     rendered = dsv.render()
     self.assertFalse(dsv.themefragments_available)
     try:
         self.assertNotIn(
             'PLONE_THEMING_THEMEFRAGMENTS_AVAILABLE',
             rendered,
         )
     except AttributeError:
         self.assertFalse(
             'PLONE_THEMING_THEMEFRAGMENTS_AVAILABLE' in rendered,
         )
Esempio n. 11
0
 def test_diazo_snippet_hide_colophon_set(self):
     """Validate the 'hide_colophon' attribute."""
     dsv = DiazoSnippetViewlet(self.portal, self.request, None)
     dsv.update()
     ploneapi.portal.set_registry_record(
         name='hide_colophon',
         value=True,
         interface=IPloneThemeSettings,
     )
     rendered = dsv.render()
     self.assertTrue(dsv.hide_colophon)
     try:
         self.assertIn('PLONE_THEMING_HIDE_COLOPHON', rendered)
     except AttributeError:
         self.assertTrue('PLONE_THEMING_HIDE_COLOPHON' in rendered)