本文整理汇总了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)
示例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)