Commit 2862d08d authored by Jérome Perrin's avatar Jérome Perrin

setDescription(None) removes the property.

Anyway, we should not rely on this behaviour when testing interaction workflows.



git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@13590 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 5b2ed66b
......@@ -221,14 +221,10 @@ class TestInteractionWorkflow(ERP5TypeTestCase):
params = 'sci,**kw'
body = "context = sci.object\n" +\
"description = context.getDescription()\n" +\
"if description is None:\n" +\
" description = ''\n" +\
"context.setDescription(description + 'a')"
self.script.ZPythonScript_edit(params,body)
self.createData()
organisation = self.organisation
organisation.setDescription(None)
self.assertEquals(organisation.getDescription(),None)
organisation.edit()
self.assertEquals(organisation.getDescription(),'a')
organisation.edit()
......@@ -268,14 +264,10 @@ class TestInteractionWorkflow(ERP5TypeTestCase):
params = 'sci,**kw'
body = "context = sci.object\n" +\
"description = context.getDescription()\n" +\
"if description is None:\n" +\
" description = ''\n" +\
"context.setDescription(description + 'a')"
self.script.ZPythonScript_edit(params,body)
self.createData()
organisation = self.organisation
organisation.setDescription(None)
self.assertEquals(organisation.getDescription(), None)
organisation.setCorporateName('corp')
self.assertEquals(organisation.getDescription(),'a')
organisation.setActivityCode('acode')
......@@ -299,16 +291,12 @@ class TestInteractionWorkflow(ERP5TypeTestCase):
body = "context = sci.object\n" +\
"context.log('InteractionWF.test_09 in script', 'a')\n" +\
"description = context.getDescription()\n" +\
"if description is None:\n" +\
" description = ''\n" +\
"context.setDescription(description + 'a')"
self.scriptA.ZPythonScript_edit(params, body)
self.scriptB.ZPythonScript_edit(params, body.replace("'a'", "'b'"))
self.createData()
organisation = self.organisation
organisation.setDescription(None)
self.assertEquals(organisation.getDescription(), None)
organisation.edit()
self.assert_(organisation.getDescription() in ('ab', 'ba'),
"description should be 'ab' or 'ba', it is %s" %
......@@ -332,16 +320,12 @@ class TestInteractionWorkflow(ERP5TypeTestCase):
body = "context = sci.object\n" +\
"context.log('InteractionWF.test_10 in script', 'a')\n" +\
"description = context.getDescription()\n" +\
"if description is None:\n" +\
" description = ''\n" +\
"context.setDescription(description + 'a')"
self.scriptA.ZPythonScript_edit(params, body)
self.scriptB.ZPythonScript_edit(params, body.replace("'a'", "'b'"))
self.createData()
organisation = self.organisation
organisation.setDescription(None)
self.assertEquals(organisation.getDescription(), None)
organisation.edit()
self.assert_(organisation.getDescription() in ('ab', 'ba'),
"description should be 'ab' or 'ba', it is %s" %
......@@ -370,8 +354,6 @@ class TestInteractionWorkflow(ERP5TypeTestCase):
body = "context = sci.object\n" +\
"context.log('InteractionWF.test_10 in script', 'a')\n" +\
"description = context.getDescription()\n" +\
"if description is None:\n" +\
" description = ''\n" +\
"context.setDescription(description + 'a')"
self.scriptA.ZPythonScript_edit(params, body)
self.scriptB.ZPythonScript_edit(params, body.replace("'a'", "'b'"))
......
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