Commit a6ddc6c1 authored by Romain Courteaud's avatar Romain Courteaud

Added a test to check if setProperty overrides edit method.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@6447 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 37f3c315
......@@ -765,6 +765,43 @@ class TestBase(ERP5TypeTestCase):
sequence_list.addSequenceString(sequence_string)
sequence_list.play(self)
def stepCheckEditMethod(self, sequence=None,
sequence_list=None, **kw):
"""
Check if edit method works.
"""
object_instance = sequence.get('object_instance')
old_edit_method = sequence.get('edit_method')
edit_method = object_instance.edit
if old_edit_method is None:
sequence.edit(edit_method=edit_method)
else:
self.assertEquals(old_edit_method, edit_method)
def stepSetEditProperty(self, sequence=None,
sequence_list=None, **kw):
"""
Check if edit method works.
"""
object_instance = sequence.get('object_instance')
object_instance.setProperty('edit', "now this object is 'read only !!!'")
def test_07_setEditProperty(self, quiet=0, run=run_all_test):
"""
Test if setProperty erase existing accessors/methods.
"""
if not run: return
sequence_list = SequenceList()
# Test on temp tempAmount.
sequence_string = '\
CreateObject \
CheckEditMethod \
SetEditProperty \
CheckEditMethod \
'
sequence_list.addSequenceString(sequence_string)
sequence_list.play(self)
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