source: products/quintagroup.plonetabs/branches/nokss/quintagroup/plonetabs/tests/test_setup.py @ 3681

Last change on this file since 3681 was 3681, checked in by mike, 7 years ago

reback renderViewlet method; remove test_kssRegistry test

File size: 2.8 KB
Line 
1import unittest
2
3from plone.browserlayer.utils import registered_layers
4
5from Products.CMFCore.utils import getToolByName
6
7from quintagroup.plonetabs.tests.base import PloneTabsTestCase
8
9
10class TestSetup(PloneTabsTestCase):
11
12    def afterSetUp(self):
13        self.loginAsPortalOwner()
14
15    def test_actionIcons(self):
16        tool = getToolByName(self.portal, 'portal_actionicons')
17        icon_ids = [i._action_id for i in tool.listActionIcons()]
18        self.failUnless('plonetabs' in icon_ids, 'There is no plonetabs action'
19                        'icon in actionicons tool.')
20
21    def test_controlPanel(self):
22        tool = getToolByName(self.portal, 'portal_controlpanel')
23        action_ids = [a.id for a in tool.listActions()]
24        self.failUnless('plonetabs' in action_ids,
25                        'There is no plonetabs action in control panel.')
26
27    def test_cssRegistry(self):
28        tool = getToolByName(self.portal, 'portal_css')
29        css = tool.getResource('++resource++plonetabs.css')
30        self.failIf(css is None, 'There is no ++resource++plonetabs.css '
31                    'stylesheets registered.')
32
33    def test_jsRegistry(self):
34        tool = getToolByName(self.portal, 'portal_javascripts')
35
36        prototype = tool.getResource('++resource++prototype.js')
37        self.failIf(prototype is None,
38                    'There is no ++resource++prototype.js script registered.')
39        self.failUnless(prototype._data['enabled'],
40                        '++resource++prototype.js script is disabled.')
41
42        effects = tool.getResource('++resource++pt_effects.js')
43        self.failIf(effects is None,
44                    'There is no ++resource++pt_effects.js script registered.')
45
46        dad = tool.getResource('++resource++sa_dragdrop.js')
47        self.failIf(dad is None, 'There is no ++resource++sa_dragdrop.js '
48                    'script registered.')
49
50    def test_propertiesTool(self):
51        tool = getToolByName(self.portal, 'portal_properties')
52        self.failUnless(hasattr(tool, 'tabs_properties'), 'There is no '
53                        'tabs_properties sheet in portal properties tool.')
54        titles = tool.tabs_properties.getProperty('titles', None)
55        self.assertEquals(titles,
56                          ('portal_tabs|Portal Tabs Configuration',
57                           'portal_footer|Portal Footer Configuration'),
58                          'Site properties was not setup properly'
59                          )
60
61    def test_browserLayerRegistered(self):
62        layers = [o.__name__ for o in registered_layers()]
63        self.failUnless('IPloneTabsProductLayer' in layers, 'There should be '
64                        'quintagroup.ploentabs browser layer registered.')
65
66
67def test_suite():
68    suite = unittest.TestSuite()
69    suite.addTest(unittest.makeSuite(TestSetup))
70    return suite
Note: See TracBrowser for help on using the repository browser.