Commit 0f421763 authored by Jérome Perrin's avatar Jérome Perrin

this test would not run in quiet mode due to a problem with indentation



git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@13207 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent d4797da9
...@@ -68,31 +68,30 @@ class TestPerson(ERP5TypeTestCase): ...@@ -68,31 +68,30 @@ class TestPerson(ERP5TypeTestCase):
def test_01_CopyPastePersonObject(self, quiet=0, run=run_all_test): def test_01_CopyPastePersonObject(self, quiet=0, run=run_all_test):
""" Test copy/paste a Person object. """ """ Test copy/paste a Person object. """
if not run: if not run:
return return
if not quiet: portal = self.getPortal()
portal = self.getPortal() person_module = self.getPersonModule()
person_module = self.getPersonModule() person = person_module.newContent(portal_type='Person')
person = person_module.newContent(portal_type='Person') person.setReference('ivan')
person.setReference('ivan')
## copy object as if using ERP5/ZMI UI ## copy object as if using ERP5/ZMI UI
person_copy = person_module.manage_copyObjects(ids=(person.getId(),)) person_copy = person_module.manage_copyObjects(ids=(person.getId(),))
person_copy_id = person_module.manage_pasteObjects(person_copy)[0]['new_id'] person_copy_id = person_module.manage_pasteObjects(person_copy)[0]['new_id']
person_copy_obj = person_module[person_copy_id] person_copy_obj = person_module[person_copy_id]
## because we copy/paste Person object in the same ERP5 ## because we copy/paste Person object in the same ERP5
## instance its reference must be resetted ## instance its reference must be resetted
self.assertEquals(person_copy_obj.getReference(), None) self.assertEquals(person_copy_obj.getReference(), None)
## set object as if installed from bt5 (simulate it) ## set object as if installed from bt5 (simulate it)
request = self.app.REQUEST request = self.app.REQUEST
request.set('is_business_template_installation', 1) request.set('is_business_template_installation', 1)
person_copy = person_module.manage_copyObjects(ids=(person.getId(),)) person_copy = person_module.manage_copyObjects(ids=(person.getId(),))
person_copy_id = person_module.manage_pasteObjects(person_copy)[0]['new_id'] person_copy_id = person_module.manage_pasteObjects(person_copy)[0]['new_id']
person_copy_obj = person_module[person_copy_id] person_copy_obj = person_module[person_copy_id]
## because we setup Person object from business template ## because we setup Person object from business template
## its reference must NOT be resetted ## its reference must NOT be resetted
self.assertEquals(person_copy_obj.getReference(), person.getReference()) self.assertEquals(person_copy_obj.getReference(), person.getReference())
if __name__ == '__main__': if __name__ == '__main__':
framework() framework()
......
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