[Erp5-report] r24192 - in /erp5/trunk/products/ERP5: ./ tests/

nobody at svn.erp5.org nobody at svn.erp5.org
Wed Oct 15 14:55:12 CEST 2008


Author: nicolas
Date: Wed Oct 15 14:54:54 2008
New Revision: 24192

URL: http://svn.erp5.org?rev=24192&view=rev
Log:
kw parameter can contain Objects which can not be pickeld. avoid to give them in activity.
Add a test for this expected behaviour

Modified:
    erp5/trunk/products/ERP5/InteractionWorkflow.py
    erp5/trunk/products/ERP5/tests/testInteractionWorkflow.py

Modified: erp5/trunk/products/ERP5/InteractionWorkflow.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/InteractionWorkflow.py?rev=24192&r1=24191&r2=24192&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/InteractionWorkflow.py (original)
+++ erp5/trunk/products/ERP5/InteractionWorkflow.py Wed Oct 15 14:54:54 2008
@@ -311,15 +311,15 @@
               for script_name in tdef.activate_script_name:
                 self.activate(activity='SQLQueue')\
                     .activeScript(script_name, ob.getRelativeUrl(),
-                                  status, tdef.id, kw)
+                                  status, tdef.id)
 
     security.declarePrivate('activeScript')
-    def activeScript(self, script_name, ob_url, status, tdef_id, kwargs=None):
+    def activeScript(self, script_name, ob_url, status, tdef_id):
           script = self.scripts[script_name]
           ob = self.unrestrictedTraverse(ob_url)
           tdef = self.interactions.get(tdef_id)
           sci = StateChangeInfo(
-                        ob, self, status, tdef, None, None, kwargs)
+                        ob, self, status, tdef, None, None, None)
           script(sci)
 
     def _getWorkflowStateOf(self, ob, id_only=0):

Modified: erp5/trunk/products/ERP5/tests/testInteractionWorkflow.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/tests/testInteractionWorkflow.py?rev=24192&r1=24191&r2=24192&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/tests/testInteractionWorkflow.py (original)
+++ erp5/trunk/products/ERP5/tests/testInteractionWorkflow.py Wed Oct 15 14:54:54 2008
@@ -527,6 +527,33 @@
     get_transaction().commit()
     self.assertEquals(organisation.getDescription(), "toto,('description',),bad")
 
+  def test_17_activity_interaction(self, quiet=0, run=run_all_test):
+    if not run: return
+    if not quiet:
+      self.logMessage('Later Script (In activity)')
+    self.createInteractionWorkflow()
+    self.interaction.setProperties(
+            'editObject',
+            once_per_transaction=1,
+            method_id='_setGroup.*',
+            activate_script_name=('afterEdit',))
+    params = 'sci, **kw'
+    body = """\
+context = sci['object']
+context.setTitle('Bar')
+"""
+    self.script.ZPythonScript_edit(params, body)
+    self.createData()
+    organisation = self.organisation
+    organisation.setTitle('Foo')
+    organisation.setGroupValue(organisation)
+    self.assertEquals(organisation.getTitle(), 'Foo')
+    get_transaction().commit()
+    self.assertEquals(organisation.getTitle(), 'Foo')
+    self.tic()
+    self.assertEquals(organisation.getTitle(), 'Bar')
+
+
   def test_regular_expression(self):
     # test that we can add an interaction by defining methods using regular
     # expression




More information about the Erp5-report mailing list