[Erp5-report] r16362 - /erp5/trunk/products/ERP5Type/tests/testERP5Type.py
nobody at svn.erp5.org
nobody at svn.erp5.org
Fri Sep 14 13:31:58 CEST 2007
Author: jerome
Date: Fri Sep 14 13:31:57 2007
New Revision: 16362
URL: http://svn.erp5.org?rev=16362&view=rev
Log:
add a simple test to exercise the use of "has" accessor
Modified:
erp5/trunk/products/ERP5Type/tests/testERP5Type.py
Modified: erp5/trunk/products/ERP5Type/tests/testERP5Type.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5Type/tests/testERP5Type.py?rev=16362&r1=16361&r2=16362&view=diff
==============================================================================
--- erp5/trunk/products/ERP5Type/tests/testERP5Type.py (original)
+++ erp5/trunk/products/ERP5Type/tests/testERP5Type.py Fri Sep 14 13:31:57 2007
@@ -1341,6 +1341,20 @@
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:
More information about the Erp5-report
mailing list