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

add a simple test to exercise the use of "has" accessor


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@16362 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent a823fb3e
......@@ -1341,6 +1341,20 @@ class TestPropertySheet:
o.validate()
self.assertEquals(o.getValidationState(), 'validated')
def test_26_hasAccessors(self):
"""Test 'has' Accessor.
This accessor returns true if the property is set on the document.
"""
self._addProperty('Person',
''' { 'id': 'foo_bar',
'type': 'string',
'mode': 'w', }''')
obj = self.getPersonModule().newContent(portal_type='Person')
self.failUnless(hasattr(obj, 'hasFooBar'))
self.failIf(obj.hasFooBar())
obj.setFooBar('something')
self.failUnless(obj.hasFooBar())
if __name__ == '__main__':
framework()
else:
......
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