示例#1
0
 def test_getPageTypes(self):
     from plone.app.page.utils import clonePageType
     from plone.app.page.utils import getPageTypes
     
     portal = self.layer['portal']
     portal_types = portal['portal_types']
     
     clonePageType(portal_types, 'page', 'new-page', u"New page", "A new page type")
     
     pageTypes = getPageTypes(portal_types)
     ids = sorted([p.getId() for p in pageTypes])
     
     self.assertEqual(ids, ['new-page', 'page'])
示例#2
0
 def pageTypes(self):
     portal_types = getToolByName(self.context, 'portal_types')
     return getPageTypes(portal_types)