Back to index

plone3  3.1.7
Public Member Functions | Public Attributes
CMFDynamicViewFTI.tests.test_browserdefault.TestAvailableLayouts Class Reference
Inheritance diagram for CMFDynamicViewFTI.tests.test_browserdefault.TestAvailableLayouts:
Inheritance graph
[legend]
Collaboration diagram for CMFDynamicViewFTI.tests.test_browserdefault.TestAvailableLayouts:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def afterSetUp
def test_Zope3View
def test_Zope3ViewTitle

Public Attributes

 types
 dfolder

Detailed Description

Definition at line 38 of file test_browserdefault.py.


Member Function Documentation

Definition at line 40 of file test_browserdefault.py.

00040 
00041     def afterSetUp(self):
00042         self.types = getToolByName(self.portal, 'portal_types')
00043 
00044         self.dfolder = DummyFolder()
00045         self.dfolder.fti = self.types['DynFolder']
00046 
00047         from Products.Five import zcml
00048         import plone.app.contentmenu
00049         import Products.CMFDynamicViewFTI.tests
00050         zcml.load_config('configure.zcml', plone.app.contentmenu)
00051         zcml.load_config('browserdefault.zcml', 
00052                          Products.CMFDynamicViewFTI.tests)
        

Definition at line 53 of file test_browserdefault.py.

00053 
00054     def test_Zope3View(self):
00055         dfolder = self.dfolder
00056         dfolder.layout = 'zope3_view'
00057         dfolder.REQUEST = zope.publisher.browser.TestRequest()
00058         view_methods = dfolder.getAvailableLayouts()
00059         view_ids = [ view_id for view_id, foo in view_methods ]
00060         self.failIf(dfolder.layout in view_ids)
00061         
00062         # Mark the object with interface connected to the zope 3 view
00063         zope.interface.directlyProvides(dfolder, IDummy)
00064         view_methods = dfolder.getAvailableLayouts()
00065         view_ids = [ view_id for view_id, foo in view_methods ]
00066         self.failIf(dfolder.layout not in view_ids)
        

Definition at line 67 of file test_browserdefault.py.

00067 
00068     def test_Zope3ViewTitle(self):
00069         dfolder = self.dfolder
00070         dfolder.layout = 'zope3_view'
00071         dfolder.REQUEST = zope.publisher.browser.TestRequest()
00072         zope.interface.directlyProvides(dfolder, IDummy)
00073         view_methods = dfolder.getAvailableLayouts()
00074         
00075         for id, title in view_methods:
00076             if id == dfolder.layout:
00077                 self.assertEqual(title, 'Zope3 Test View')
        

Member Data Documentation

Definition at line 43 of file test_browserdefault.py.

Definition at line 41 of file test_browserdefault.py.


The documentation for this class was generated from the following file: