本文整理汇总了Python中OFS.Folder.Folder.hebrew方法的典型用法代码示例。如果您正苦于以下问题:Python Folder.hebrew方法的具体用法?Python Folder.hebrew怎么用?Python Folder.hebrew使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OFS.Folder.Folder
的用法示例。
在下文中一共展示了Folder.hebrew方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_store_selection_properties
# 需要导入模块: from OFS.Folder import Folder [as 别名]
# 或者: from OFS.Folder.Folder import hebrew [as 别名]
def test_store_selection_properties(self):
conn = self.db.open()
try:
app = conn.root()['Application']
f = Folder()
f.id = 'Holidays'
f.title = 'Holiday Calendar'
app._setObject(f.id, f, set_owner=0)
transaction.commit()
f._setProperty('choices', ['alpha', 'omega', 'delta'], 'lines')
f._setProperty('greek', 'choices', 'multiple selection')
f._setProperty('hebrew', 'choices', 'selection')
f.greek = ['alpha', 'omega']
f.hebrew = 'alpha'
transaction.commit()
conn2 = self.db.open()
try:
app = conn2.root()['Application']
self.assert_(hasattr(app, 'Holidays'))
got = 0
for k, v in app.Holidays.propertyItems():
if k == 'greek':
got += 1
self.assertEqual(tuple(v), ('alpha', 'omega'))
if k == 'hebrew':
got += 1
self.assertEqual(v, 'alpha')
self.assertEqual(got, 2)
# Be sure the select_variable got restored.
dict = app.Holidays.propdict()
self.assertEqual(dict['greek']['select_variable'], 'choices')
self.assertEqual(dict['hebrew']['select_variable'], 'choices')
finally:
conn2.close()
finally:
conn.close()