[Erp5-report] r6447 - /erp5/trunk/products/ERP5/tests/testBase.py

nobody at svn.erp5.org nobody at svn.erp5.org
Tue Apr 4 10:54:17 CEST 2006


Author: romain
Date: Tue Apr  4 10:54:14 2006
New Revision: 6447

URL: http://svn.erp5.org?rev=6447&view=rev
Log:
Added a test to check if setProperty overrides edit method.

Modified:
    erp5/trunk/products/ERP5/tests/testBase.py

Modified: erp5/trunk/products/ERP5/tests/testBase.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/tests/testBase.py?rev=6447&r1=6446&r2=6447&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/tests/testBase.py (original)
+++ erp5/trunk/products/ERP5/tests/testBase.py Tue Apr  4 10:54:14 2006
@@ -765,6 +765,43 @@
     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:




More information about the Erp5-report mailing list