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

nobody at svn.erp5.org nobody at svn.erp5.org
Wed Aug 27 10:00:49 CEST 2008


Author: jerome
Date: Wed Aug 27 10:00:46 2008
New Revision: 23184

URL: http://svn.erp5.org?rev=23184&view=rev
Log:
more test of what setProperty should not be allowed to do

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=23184&r1=23183&r2=23184&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/tests/testBase.py (original)
+++ erp5/trunk/products/ERP5/tests/testBase.py Wed Aug 27 10:00:46 2008
@@ -746,8 +746,17 @@
     Check if edit method works.
     """
     object_instance = sequence.get('object_instance')
-    self.assertRaises(BadRequest,object_instance.setProperty, 'edit', 
+    # can't override a method:
+    self.assertRaises(BadRequest, object_instance.setProperty, 'edit',
                       "now this object is 'read only !!!'")
+    # can't change the portal type and other internal instance attributes
+    self.assertRaises(BadRequest, object_instance.setProperty,
+                      'portal_type', "Other")
+    self.assertRaises(BadRequest, object_instance.setProperty,
+                      'workflow_history', {})
+    self.assertRaises(BadRequest, object_instance.setProperty,
+                      '__dict__', {})
+
 
   def test_07_setEditProperty(self, quiet=quiet, run=run_all_test):
     """
@@ -755,7 +764,6 @@
     """
     if not run: return
     sequence_list = SequenceList()
-    # Test on temp tempAmount.
     sequence_string = '\
               CreateObject \
               CheckEditMethod \




More information about the Erp5-report mailing list