[Erp5-report] r33621 kazuhiko - /erp5/trunk/products/ERP5/tests/testBusinessTemplate.py

nobody at svn.erp5.org nobody at svn.erp5.org
Thu Mar 11 10:05:25 CET 2010


Author: kazuhiko
Date: Thu Mar 11 10:05:24 2010
New Revision: 33621

URL: http://svn.erp5.org?rev=33621&view=rev
Log:
expand test_041_BusinessTemplateWithWorkflowRemoved to check if workflow chain is well updated after removing a workflow.

Modified:
    erp5/trunk/products/ERP5/tests/testBusinessTemplate.py

Modified: erp5/trunk/products/ERP5/tests/testBusinessTemplate.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/tests/testBusinessTemplate.py?rev=33621&r1=33620&r2=33621&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/tests/testBusinessTemplate.py [utf8] (original)
+++ erp5/trunk/products/ERP5/tests/testBusinessTemplate.py [utf8] Thu Mar 11 10:05:24 2010
@@ -107,8 +107,12 @@
     props = {}
     if cbt is not None:
       for id, wf_ids in cbt.items():
+        wf_ids = list(wf_ids)
+        if 'geek_workflow' in wf_ids:
+          wf_ids.remove('geek_workflow')
         if id != "Geek Object":
           props['chain_%s' % id] = ', '.join(wf_ids)
+
     pw.manage_changeWorkflows('', props=props)
     if 'erp5_geek' in self.getSkinsTool().objectIds():
       self.getSkinsTool().manage_delObjects(['erp5_geek'])
@@ -1186,6 +1190,34 @@
     props['chain_Geek Object'] = wf_id
     pw.manage_changeWorkflows('', props=props)
 
+  def stepModifyWorkflowChain(self, sequence=None, sequence_list=None, **kw):
+    """
+    Modify the workflow chain not by business template installation
+    """
+    wf_id = 'geek_workflow'
+    pw = self.getWorkflowTool()
+    workflow = pw._getOb(wf_id, None)
+    self.failUnless(workflow is not None)
+    cbt = pw._chains_by_type
+    props = {}
+    if cbt is not None:
+      for id, wf_ids in cbt.items():
+        props['chain_%s' % id] = ','.join(wf_ids)
+    props['chain_Base Category'] = 'edit_workflow,%s' % wf_id
+    pw.manage_changeWorkflows('', props=props)
+
+  def stepSaveWorkflowChain(self, sequence=None, sequence_list=None, **kw):
+    """
+    Save the workflow chain as it is
+    """
+    pw = self.getWorkflowTool()
+    cbt = pw._chains_by_type
+    props = {}
+    if cbt is not None:
+      for id, wf_ids in cbt.items():
+        props['chain_%s' % id] = ','.join(wf_ids)
+    pw.manage_changeWorkflows('', props=props)
+
   def stepCheckWorkflowChainRemoved(self, sequence=None, sequence_list=None, **kw):
     """
     Check if the workflowChain has been removed
@@ -1244,7 +1276,7 @@
     if cbt is not None:
       for id, wf_ids in cbt.items():
         wf_ids = list(wf_ids)
-        if id == "Geek Object":
+        if wf_id in wf_ids:
           wf_ids.remove(wf_id)
         props['chain_%s' % id] = ','.join(wf_ids)
     pw.manage_changeWorkflows('', props=props)
@@ -2933,6 +2965,7 @@
                        CheckBuiltBuildingState \
                        CheckNotInstalledInstallationState \
                        InstallBusinessTemplate \
+                       ModifyWorkflowChain \
                        Tic \
                        CheckInstalledInstallationState \
                        CheckBuiltBuildingState \
@@ -2964,6 +2997,7 @@
                        CheckSkinsLayers \
                        CheckWorkflowRemoved \
                        CheckWorkflowChainRemoved \
+                       SaveWorkflowChain \
                        '
     sequence_list.addSequenceString(sequence_string)
     sequence_list.play(self, quiet=quiet)




More information about the Erp5-report mailing list