Commit 8fba7f06 authored by Jérome Perrin's avatar Jérome Perrin

check that OFS API can be used on a hierarchy of temp objects.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@24243 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent b9d73d97
......@@ -327,6 +327,30 @@ class TestERP5Type(PropertySheetTestCase, LogInterceptor):
self.assertEquals(first_id, second_id)
self.assertEquals('None', second_id)
# Check temp objects subobjects can be accessed with OFS API
parent = portal.person_module.newContent(portal_type="Person",
temp_object=1)
child1 = parent.newContent(portal_type='Person', id='1')
child11 = child1.newContent(portal_type='Person', id='1')
child2 = parent.newContent(portal_type='Person', id='2')
self.assertEquals(child1, parent._getOb('1'))
self.assertEquals(child2, parent._getOb('2'))
self.assertEquals(child1, parent['1'])
self.assertEquals(child2, parent['2'])
self.assertEquals(child1, getattr(parent, '1'))
self.assertEquals(child2, getattr(parent, '2'))
self.assertEquals(child1, parent.restrictedTraverse('1'))
self.assertEquals(child11, parent.restrictedTraverse('1/1'))
self.assertEquals(child2, parent.restrictedTraverse('2'))
self.assertEquals(('person_module', 'None', '1', '1'),
self.portal.portal_url.getRelativeContentPath(child11))
def test_04_CategoryAccessors(self, quiet=quiet, run=run_all_test):
"""
This test provides basic testing of category
......
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