Commit ebb6ff26 authored by Sebastien Robin's avatar Sebastien Robin

added one test


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@2785 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 63b10b3f
...@@ -110,6 +110,8 @@ class Test(ERP5TypeTestCase): ...@@ -110,6 +110,8 @@ class Test(ERP5TypeTestCase):
""" """
self.setDescription(value) self.setDescription(value)
Organisation.doSomethingStupid = doSomethingStupid Organisation.doSomethingStupid = doSomethingStupid
portal_type = self.getTypeTool()['Organisation']
portal_type.base_category_list = ['size']
def createInteractionWorkflow(self): def createInteractionWorkflow(self):
...@@ -149,6 +151,7 @@ class Test(ERP5TypeTestCase): ...@@ -149,6 +151,7 @@ class Test(ERP5TypeTestCase):
self.script.ZPythonScript_edit(params,body) self.script.ZPythonScript_edit(params,body)
self.createData() self.createData()
organisation = self.organisation organisation = self.organisation
organisation.setDescription('bad')
organisation.edit() organisation.edit()
self.assertEquals(organisation.getDescription(),'toto') self.assertEquals(organisation.getDescription(),'toto')
...@@ -164,6 +167,7 @@ class Test(ERP5TypeTestCase): ...@@ -164,6 +167,7 @@ class Test(ERP5TypeTestCase):
self.script.ZPythonScript_edit(params,body) self.script.ZPythonScript_edit(params,body)
self.createData() self.createData()
organisation = self.organisation organisation = self.organisation
organisation.setDescription('bad')
organisation.edit(description='tutu') organisation.edit(description='tutu')
self.assertEquals(organisation.getDescription(),'toto') self.assertEquals(organisation.getDescription(),'toto')
...@@ -179,9 +183,26 @@ class Test(ERP5TypeTestCase): ...@@ -179,9 +183,26 @@ class Test(ERP5TypeTestCase):
self.script.ZPythonScript_edit(params,body) self.script.ZPythonScript_edit(params,body)
self.createData() self.createData()
organisation = self.organisation organisation = self.organisation
organisation.setDescription('bad')
organisation.doSomethingStupid('tutu') organisation.doSomethingStupid('tutu')
self.assertEquals(organisation.getDescription(),'toto') self.assertEquals(organisation.getDescription(),'toto')
def test_05(self, quiet=0, run=run_all_test):
if not run: return
if not quiet:
self.logMessage('Interactions, Automatic Workflow Method With Extra Base Category')
self.createInteractionWorkflow()
self.interaction.setProperties('afterEdit',method_id='setSizeList _setSizeList',after_script_name=('afterEdit',))
body = "context = sci.object\n" +\
"context.setDescription('toto')"
params = 'sci,**kw'
self.script.ZPythonScript_edit(params,body)
self.createData()
organisation = self.organisation
organisation.setDescription('bad')
organisation.setSizeList(['size/1','size/2'])
self.assertEquals(organisation.getDescription(),'toto')
if __name__ == '__main__': if __name__ == '__main__':
......
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