当前位置: 首页>>代码示例>>Python>>正文


Python SimpleItem._getProductRegistryData方法代码示例

本文整理汇总了Python中OFS.SimpleItem.SimpleItem._getProductRegistryData方法的典型用法代码示例。如果您正苦于以下问题:Python SimpleItem._getProductRegistryData方法的具体用法?Python SimpleItem._getProductRegistryData怎么用?Python SimpleItem._getProductRegistryData使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在OFS.SimpleItem.SimpleItem的用法示例。


在下文中一共展示了SimpleItem._getProductRegistryData方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_manage_propertiesForm_allows_adding

# 需要导入模块: from OFS.SimpleItem import SimpleItem [as 别名]
# 或者: from OFS.SimpleItem.SimpleItem import _getProductRegistryData [as 别名]
    def test_manage_propertiesForm_allows_adding(self):
        from OFS.SimpleItem import SimpleItem
        def _header(*args, **kw):
            return 'HEADER'
        def _footer(*args, **kw):
            return 'HEADER'
        container = SimpleItem()

        container.REQUEST = request = DummyRequest()
        request.set('manage_page_header', _header)
        request.set('manage_page_footer', _footer)
        request.set('BASEPATH1', '/one/two')
        setattr(request, 'URL1', '/one/two')
        request._steps = ['one', 'two']

        prd = {'ac_permissions': ('a', 'b')}
        container._getProductRegistryData = prd.get

        a = self._makeOne('extensible').__of__(container)
        form_html = a.manage_propertiesForm(request)

        self.failUnless('value=" Add "' in form_html)
开发者ID:c0ns0le,项目名称:zenoss-4,代码行数:24,代码来源:test_ActionInformation.py

示例2: test_manage_propertiesForm_allows_adding

# 需要导入模块: from OFS.SimpleItem import SimpleItem [as 别名]
# 或者: from OFS.SimpleItem.SimpleItem import _getProductRegistryData [as 别名]
    def test_manage_propertiesForm_allows_adding(self):
        from OFS.SimpleItem import SimpleItem

        def _header(*args, **kw):
            return 'HEADER'

        def _footer(*args, **kw):
            return 'HEADER'

        def _main(*args, **kw):
            return 'MAIN'

        container = SimpleItem()

        container.REQUEST = request = DummyRequest()
        request.set('manage_page_header', _header)
        request.set('manage_page_footer', _footer)
        request.set('manage_main', _main)
        request.set('RESPONSE', None)
        request.set('BASEPATH1', '/one/two')
        request.set('URL', '/one/two/manage_propertiesForm')
        request.set('URL0', '/one')
        request.set('URL1', '/one/two')
        setattr(request, 'URL1', '/one/two')
        request._steps = ['one', 'two']

        prd = {'ac_permissions': ('a', 'b')}
        container._getProductRegistryData = prd.get

        a = self._makeOne('extensible').__of__(container)
        # EEK short-term solution until a new Zope release is out
        from App.special_dtml import DTMLFile
        DTMLFile.encoding = None
        form_html = a.manage_propertiesForm(request)

        self.assertIn('value="Add"', form_html)
开发者ID:zopefoundation,项目名称:Products.CMFCore,代码行数:38,代码来源:test_ActionInformation.py


注:本文中的OFS.SimpleItem.SimpleItem._getProductRegistryData方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。