Back to index

plone3  3.1.7
testRenderBase.py
Go to the documentation of this file.
00001 #
00002 # Tests for renderBase.py
00003 #
00004 
00005 from Products.CMFPlone.tests import PloneTestCase
00006 
00007 
00008 class TestRenderBase(PloneTestCase.FunctionalTestCase):
00009 
00010     def afterSetUp(self):
00011         self.folder_path = '/%s' % self.folder.absolute_url(1)
00012         self.folder.invokeFactory('Document', id='doc')
00013         self.portal.manage_addDTMLMethod('a_view', file='<dtml-var renderBase>')
00014 
00015     def testRenderBase(self):
00016         self.assertEqual(self.folder.renderBase(),
00017                          self.folder.absolute_url()+'/')
00018 
00019     def testFolderBase(self):
00020         base = self.publish(self.folder_path+'/renderBase')
00021         self.assertEqual(base.getBody(),
00022                          self.folder.absolute_url()+'/')
00023 
00024     def testFolderViewBase(self):
00025         base = self.publish(self.folder_path+'/a_view')
00026         self.assertEqual(base.getBody(),
00027                          self.folder.absolute_url()+'/')
00028 
00029     def testDocumentBase(self):
00030         base = self.publish(self.folder_path+'/doc/renderBase')
00031         self.assertEqual(base.getBody(),
00032                          self.folder.doc.absolute_url())
00033 
00034     def testDocumentViewBase(self):
00035         base = self.publish(self.folder_path+'/doc/a_view')
00036         self.assertEqual(base.getBody(),
00037                          self.folder.doc.absolute_url())
00038 
00039 
00040 def test_suite():
00041     from unittest import TestSuite, makeSuite
00042     suite = TestSuite()
00043     suite.addTest(makeSuite(TestRenderBase))
00044     return suite