Back to index

plone3  3.1.7
test_tools.py
Go to the documentation of this file.
00001 import unittest
00002 from plone.app.layout.globals.tests.base import GlobalsTestCase
00003 
00004 from Products.CMFPlone.utils import getToolByName
00005 
00006 class TestToolsView(GlobalsTestCase):
00007     """Ensure that the basic redirector setup is successful.
00008     """
00009     
00010     def afterSetUp(self):
00011         self.view = self.folder.restrictedTraverse('@@plone_tools')
00012     
00013     def test_actions(self):
00014         self.assertEquals(self.view.actions(), getToolByName(self.folder, 'portal_actions'))
00015         
00016     def test_catalog(self):
00017         self.assertEquals(self.view.catalog(), getToolByName(self.folder, 'portal_catalog'))
00018         
00019     def test_membership(self):
00020         self.assertEquals(self.view.membership(), getToolByName(self.folder, 'portal_membership'))
00021         
00022     def test_properties(self):
00023         self.assertEquals(self.view.properties(), getToolByName(self.folder, 'portal_properties'))
00024         
00025     def test_syndication(self):
00026         self.assertEquals(self.view.syndication(), getToolByName(self.folder, 'portal_syndication'))
00027         
00028     def test_types(self):
00029         self.assertEquals(self.view.types(), getToolByName(self.folder, 'portal_types'))
00030         
00031     def test_url(self):
00032         self.assertEquals(self.view.url(), getToolByName(self.folder, 'portal_url'))
00033 
00034     def test_workflow(self):
00035         self.assertEquals(self.view.workflow(), getToolByName(self.folder, 'portal_workflow'))
00036 
00037 def test_suite():
00038     suite = unittest.TestSuite()
00039     suite.addTest(unittest.makeSuite(TestToolsView))
00040     return suite