Commit c4bca3cc authored by Aurel's avatar Aurel

add test to check actions order


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@4855 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 78ca1967
...@@ -63,7 +63,6 @@ class TestBusinessTemplate(ERP5TypeTestCase): ...@@ -63,7 +63,6 @@ class TestBusinessTemplate(ERP5TypeTestCase):
""" """
run_all_test = 1 run_all_test = 1
def getTitle(self): def getTitle(self):
return "Business Template" return "Business Template"
...@@ -671,9 +670,9 @@ class TestBusinessTemplate(ERP5TypeTestCase): ...@@ -671,9 +670,9 @@ class TestBusinessTemplate(ERP5TypeTestCase):
self.failUnless(workflow is None) self.failUnless(workflow is None)
# Actions # Actions
def stepCreateActions(self, sequence=None, sequence_list=None, **kw): def stepCreateAction(self, sequence=None, sequence_list=None, **kw):
""" """
Create actions Create action
""" """
pt = self.getTypeTool() pt = self.getTypeTool()
object_id = sequence.get('object_ptype_id') object_id = sequence.get('object_ptype_id')
...@@ -686,7 +685,17 @@ class TestBusinessTemplate(ERP5TypeTestCase): ...@@ -686,7 +685,17 @@ class TestBusinessTemplate(ERP5TypeTestCase):
, permission = ('View', ) , permission = ('View', )
, category = 'object_action' , category = 'object_action'
, visible = 1 , visible = 1
, optional = 0 ) , optional = 0
, priority = 2.0 )
sequence.edit(action_id='become_geek')
def stepCreateOptionalAction(self, sequence=None, sequence_list=None, **kw):
"""
Create optional action
"""
pt = self.getTypeTool()
object_id = sequence.get('object_ptype_id')
object_pt = pt._getOb(object_id)
object_pt.addAction( object_pt.addAction(
id = 'become_nerd' id = 'become_nerd'
, name = 'Become Nerd' , name = 'Become Nerd'
...@@ -695,8 +704,23 @@ class TestBusinessTemplate(ERP5TypeTestCase): ...@@ -695,8 +704,23 @@ class TestBusinessTemplate(ERP5TypeTestCase):
, permission = ('View', ) , permission = ('View', )
, category = 'object_action' , category = 'object_action'
, visible = 1 , visible = 1
, optional = 1 ) , optional = 1
sequence.edit(action_id='become_geek', opt_action_id='become_nerd') , priority = 1.5 )
sequence.edit(opt_action_id='become_nerd')
def stepCheckActionsOrder(self, sequence=None, sequence_list=None, **kw):
"""
Check Actions Order
"""
pt = self.getTypeTool()
object_id = sequence.get('object_ptype_id')
object_pt = pt._getOb(object_id)
actions_list = object_pt.listActions()
priority = 0
for action in actions_list:
self.failIf(action.priority < priority)
priority = action.priority
def stepCheckActionExists(self, sequence=None, sequence_list=None, **kw): def stepCheckActionExists(self, sequence=None, sequence_list=None, **kw):
""" """
...@@ -1425,7 +1449,8 @@ class TestBusinessTemplate(ERP5TypeTestCase): ...@@ -1425,7 +1449,8 @@ class TestBusinessTemplate(ERP5TypeTestCase):
sequence_list = SequenceList() sequence_list = SequenceList()
sequence_string = '\ sequence_string = '\
CreatePortalType \ CreatePortalType \
CreateActions \ CreateAction \
CreateOptionalAction \
CreateNewBusinessTemplate \ CreateNewBusinessTemplate \
UseExportBusinessTemplate \ UseExportBusinessTemplate \
CheckModifiedBuildingState \ CheckModifiedBuildingState \
...@@ -1471,7 +1496,8 @@ class TestBusinessTemplate(ERP5TypeTestCase): ...@@ -1471,7 +1496,8 @@ class TestBusinessTemplate(ERP5TypeTestCase):
sequence_list = SequenceList() sequence_list = SequenceList()
sequence_string = '\ sequence_string = '\
CreatePortalType \ CreatePortalType \
CreateActions \ CreateAction \
CreateOptionalAction \
CreateNewBusinessTemplate \ CreateNewBusinessTemplate \
UseExportBusinessTemplate \ UseExportBusinessTemplate \
CheckModifiedBuildingState \ CheckModifiedBuildingState \
...@@ -1488,6 +1514,7 @@ class TestBusinessTemplate(ERP5TypeTestCase): ...@@ -1488,6 +1514,7 @@ class TestBusinessTemplate(ERP5TypeTestCase):
RemoveBusinessTemplate \ RemoveBusinessTemplate \
RemoveAllTrashBins \ RemoveAllTrashBins \
CreatePortalType \ CreatePortalType \
CreateAction \
ImportBusinessTemplate \ ImportBusinessTemplate \
UseImportBusinessTemplate \ UseImportBusinessTemplate \
CheckBuiltBuildingState \ CheckBuiltBuildingState \
...@@ -1498,8 +1525,9 @@ class TestBusinessTemplate(ERP5TypeTestCase): ...@@ -1498,8 +1525,9 @@ class TestBusinessTemplate(ERP5TypeTestCase):
CheckBuiltBuildingState \ CheckBuiltBuildingState \
CheckTrashBin \ CheckTrashBin \
CheckSkinsLayers \ CheckSkinsLayers \
CheckActionNotExists \ CheckActionExists \
CheckOptionalActionExists \ CheckOptionalActionExists \
CheckActionsOrder \
UninstallBusinessTemplate \ UninstallBusinessTemplate \
CheckBuiltBuildingState \ CheckBuiltBuildingState \
CheckNotInstalledInstallationState \ CheckNotInstalledInstallationState \
...@@ -1797,7 +1825,8 @@ class TestBusinessTemplate(ERP5TypeTestCase): ...@@ -1797,7 +1825,8 @@ class TestBusinessTemplate(ERP5TypeTestCase):
CreateCategories \ CreateCategories \
CreateSubCategories \ CreateSubCategories \
CreateWorkflow \ CreateWorkflow \
CreateActions \ CreateAction \
CreateOptionalAction \
CreateCatalogMethod \ CreateCatalogMethod \
CreateKeysAndTable \ CreateKeysAndTable \
CreateRole \ CreateRole \
...@@ -1971,7 +2000,8 @@ class TestBusinessTemplate(ERP5TypeTestCase): ...@@ -1971,7 +2000,8 @@ class TestBusinessTemplate(ERP5TypeTestCase):
CreateCategories \ CreateCategories \
CreateSubCategories \ CreateSubCategories \
CreateWorkflow \ CreateWorkflow \
CreateActions \ CreateAction \
CreateOptionalAction \
CreateCatalogMethod \ CreateCatalogMethod \
CreateKeysAndTable \ CreateKeysAndTable \
CreateRole \ CreateRole \
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment