Python IRightColumn Example

说明

python irightcolumn示例是从最受好评的开源项目中提取的实现代码,你可以参考下面示例的使用方式。

编程语言: Python

命名空间/包名称: ploneappportletsinterfaces

示例#1
文件: test_setup.py项目: headnet/plone.app.portlets

    def testInterfaces(self):
        left = getUtility(IPortletManager, 'plone.leftcolumn')
        right = getUtility(IPortletManager, 'plone.rightcolumn')
        dashboard = getUtility(IPortletManager, 'plone.dashboard1')

        self.assertTrue(ILeftColumn.providedBy(left))
        self.assertTrue(IRightColumn.providedBy(right))
        self.assertTrue(IDashboard.providedBy(dashboard))

示例#2
文件: test_setup.py项目: collective/collective.personalportletcolumn

    def testPortletManagersRegistered(self):
        right = getUtility(IPortletManager, 'plone.rightcolumn')
        self.failUnless(IRightColumn.providedBy(right))
        self.failIf(IPersonalPortletManager.providedBy(right))

        # Install it
        self.addProfile('collective.personalportletcolumn:default')

        right = getUtility(IPortletManager, 'plone.rightcolumn')
        self.failIf(IRightColumn.providedBy(right))
        self.failUnless(IPersonalPortletManager.providedBy(right))

        # Unistall it
        self.addProfile('collective.personalportletcolumn:uninstall')

        right = getUtility(IPortletManager, 'plone.rightcolumn')
        self.failUnless(IRightColumn.providedBy(right))
        self.failIf(IPersonalPortletManager.providedBy(right))

展开阅读全文