本文整理匯總了Python中Products.CMFCore.ActionInformation.ActionInformation.getCondition方法的典型用法代碼示例。如果您正苦於以下問題:Python ActionInformation.getCondition方法的具體用法?Python ActionInformation.getCondition怎麽用?Python ActionInformation.getCondition使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Products.CMFCore.ActionInformation.ActionInformation
的用法示例。
在下文中一共展示了ActionInformation.getCondition方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: test_basic_construction
# 需要導入模塊: from Products.CMFCore.ActionInformation import ActionInformation [as 別名]
# 或者: from Products.CMFCore.ActionInformation.ActionInformation import getCondition [as 別名]
def test_basic_construction(self):
ai = ActionInformation(id='view'
)
self.assertEqual(ai.getId(), 'view')
self.assertEqual(ai.Title(), 'view')
self.assertEqual(ai.Description(), '')
self.assertEqual(ai.getCondition(), '')
self.assertEqual(ai.getActionExpression(), '')
self.assertEqual(ai.getVisibility(), 1)
self.assertEqual(ai.getCategory(), 'object')
self.assertEqual(ai.getPermissions(), ())
示例2: test_editing
# 需要導入模塊: from Products.CMFCore.ActionInformation import ActionInformation [as 別名]
# 或者: from Products.CMFCore.ActionInformation.ActionInformation import getCondition [as 別名]
def test_editing(self):
ai = ActionInformation(id='view',
category='folder',
)
ai.edit(id='new_id', title='blah')
self.assertEqual(ai.getId(), 'new_id')
self.assertEqual(ai.Title(), 'blah')
self.assertEqual(ai.Description(), '')
self.assertEqual(ai.getCondition(), '')
self.assertEqual(ai.getActionExpression(), '')
self.assertEqual(ai.getVisibility(), 1)
self.assertEqual(ai.getCategory(), 'folder')
self.assertEqual(ai.getPermissions(), ())
示例3: test_construction_with_Expressions
# 需要導入模塊: from Products.CMFCore.ActionInformation import ActionInformation [as 別名]
# 或者: from Products.CMFCore.ActionInformation.ActionInformation import getCondition [as 別名]
def test_construction_with_Expressions(self):
ai = ActionInformation(id='view'
, title='View'
, action=Expression(
text='view')
, condition=Expression(
text='member')
, category='global'
, visible=0)
self.assertEqual(ai.getId(), 'view')
self.assertEqual(ai.Title(), 'View')
self.assertEqual(ai.Description(), '')
self.assertEqual(ai.getCondition(), 'member')
self.assertEqual(ai.getActionExpression(), 'string:view')
self.assertEqual(ai.getVisibility(), 0)
self.assertEqual(ai.getCategory(), 'global')
self.assertEqual(ai.getPermissions(), ())