Commit 7321fa7f authored by Jérome Perrin's avatar Jérome Perrin

test that we can add an interaction by defining methods using regular expression


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@18685 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent a4a71670
......@@ -476,6 +476,31 @@ context.setDescription('%s,%s,%s' % (d, args, result))
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))
......
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