extend test to explicitly cover bug #712

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@39127 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 8594fb33
...@@ -1279,10 +1279,16 @@ class TestPropertySheet: ...@@ -1279,10 +1279,16 @@ class TestPropertySheet:
self.assertEquals(email.getDefaultAvailableLanguage(), 'ja') self.assertEquals(email.getDefaultAvailableLanguage(), 'ja')
self.assertEquals(email.getAvailableLanguageList(), ('ja', 'fr', 'en')) self.assertEquals(email.getAvailableLanguageList(), ('ja', 'fr', 'en'))
NAME_INCLUDED_PROPERTY = ''' NAME_INCLUDED_PROPERTY_PERSON = '''
{ 'id': 'name_included_in_address', { 'id': 'name_included_in_address',
'type': 'boolean', 'type': 'boolean',
'default' : False, 'default' : True,
'mode': 'rw', }
'''
NAME_INCLUDED_PROPERTY_EMAIL = '''
{ 'id': 'name_included_in_address',
'type': 'boolean',
'default' : True,
'acquired_property_id': ('name_included_in_address', ), 'acquired_property_id': ('name_included_in_address', ),
'acquisition_base_category': ( 'parent', ), 'acquisition_base_category': ( 'parent', ),
'acquisition_portal_type' : ( 'Person', ), 'acquisition_portal_type' : ( 'Person', ),
...@@ -1299,21 +1305,28 @@ class TestPropertySheet: ...@@ -1299,21 +1305,28 @@ class TestPropertySheet:
Boolean accessors generate both an getPropertyName and an isPropertyName Boolean accessors generate both an getPropertyName and an isPropertyName
Check in particular that both behave the same way regarding acquisition Check in particular that both behave the same way regarding acquisition
""" """
self._addProperty('Person', self.NAME_INCLUDED_PROPERTY) self._addProperty('Person', self.NAME_INCLUDED_PROPERTY_PERSON)
self._addProperty('Email', self.NAME_INCLUDED_PROPERTY) self._addProperty('Email', self.NAME_INCLUDED_PROPERTY_EMAIL)
person = self.getPersonModule().newContent(portal_type='Person') person = self.getPersonModule().newContent(portal_type='Person')
email = person.newContent(portal_type='Email') email = person.newContent(portal_type='Email')
self.assertTrue(person.getNameIncludedInAddress())
self.assertTrue(person.isNameIncludedInAddress())
self.assertTrue(email.getNameIncludedInAddress())
self.assertTrue(email.isNameIncludedInAddress())
# setting the property on the acquisition target should be reflected on
# the object acquiring the value
person.setNameIncludedInAddress(False)
self.assertFalse(person.getNameIncludedInAddress()) self.assertFalse(person.getNameIncludedInAddress())
self.assertFalse(person.isNameIncludedInAddress()) self.assertFalse(person.isNameIncludedInAddress())
self.assertFalse(email.getNameIncludedInAddress()) self.assertFalse(email.getNameIncludedInAddress())
self.assertFalse(email.isNameIncludedInAddress()) self.assertFalse(email.isNameIncludedInAddress())
# setting it to true on the acquisition target should be reflected on the # setting the property on the acquiring object should mask the value on
# object acquiring the value # the acquisition target.
person.setNameIncludedInAddress(True) email.setNameIncludedInAddress(True)
self.assertTrue(person.getNameIncludedInAddress()) self.assertFalse(person.getNameIncludedInAddress())
self.assertTrue(person.isNameIncludedInAddress()) self.assertFalse(person.isNameIncludedInAddress())
self.assertTrue(email.getNameIncludedInAddress()) self.assertTrue(email.getNameIncludedInAddress())
self.assertTrue(email.isNameIncludedInAddress()) self.assertTrue(email.isNameIncludedInAddress())
......
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