[Erp5-report] r18685 - /erp5/trunk/products/ERP5/tests/testInteractionWorkflow.py

nobody at svn.erp5.org nobody at svn.erp5.org
Mon Jan 14 14:08:45 CET 2008


Author: jerome
Date: Mon Jan 14 14:08:43 2008
New Revision: 18685

URL: http://svn.erp5.org?rev=18685&view=rev
Log:
test that we can add an interaction by defining methods using regular expression

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

Modified: erp5/trunk/products/ERP5/tests/testInteractionWorkflow.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/tests/testInteractionWorkflow.py?rev=18685&r1=18684&r2=18685&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/tests/testInteractionWorkflow.py (original)
+++ erp5/trunk/products/ERP5/tests/testInteractionWorkflow.py Mon Jan 14 14:08:43 2008
@@ -476,6 +476,31 @@
     value = organisation.getDescription()
     self.assertEquals(value, "toto,('description',),bad")
 
+  def test_regular_expression(self):
+    # test that we can add an interaction by defining methods using regular
+    # expression
+    self.createInteractionWorkflow()
+    self.interaction.setProperties(
+            'regexp',
+            method_id='set.*',
+            after_script_name=('afterEdit',))
+
+    call_list = self.portal.REQUEST['call_list'] = []
+    self.script.ZPythonScript_edit('sci',
+        'container.REQUEST["call_list"].append(1)')
+    self.createData()
+    organisation = self.organisation
+    # all methods matching set.* regular expression are matched
+    organisation.setDescription('')
+    self.assertEquals(len(call_list), 1)
+    organisation.setTitle('')
+    self.assertEquals(len(call_list), 2)
+    organisation.getDescription()
+    self.assertEquals(len(call_list), 2)
+    organisation.edit(description='desc')
+    self.assertEquals(len(call_list), 3)
+
+
 def test_suite():
   suite = unittest.TestSuite()
   suite.addTest(unittest.makeSuite(TestInteractionWorkflow))




More information about the Erp5-report mailing list