[Erp5-report] r26214 - /erp5/trunk/products/ERP5Type/tests/testERP5Type.py

nobody at svn.erp5.org nobody at svn.erp5.org
Tue Mar 31 17:40:30 CEST 2009


Author: jm
Date: Tue Mar 31 17:40:25 2009
New Revision: 26214

URL: http://svn.erp5.org?rev=26214&view=rev
Log:
Add unit test to show there is no difference between contentValues and objectValues about security.

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=26214&r1=26213&r2=26214&view=diff
==============================================================================
--- erp5/trunk/products/ERP5Type/tests/testERP5Type.py [utf8] (original)
+++ erp5/trunk/products/ERP5Type/tests/testERP5Type.py [utf8] Tue Mar 31 17:40:25 2009
@@ -2609,6 +2609,26 @@
       person.setProperty('foo_bar_list', ['foo', 'bar'])
       self.assertEquals(list(person.getProperty('foo_bar_list')), ['foo', 'bar'])
 
+    def test_objectValues_contentValues(self):
+      """
+      Test checked_permission parameter on Folder.objectValues and
+      Folder.contentValues.
+      Also test that there is no difference between objectValues and
+      contentValues about security.
+      """
+      person = self.getPersonModule().newContent(portal_type='Person')
+      address = person.newContent(portal_type='Address')
+
+      def check(count):
+        for values in person.objectValues, person.contentValues:
+          self.assertEqual(1, len(values()))
+          self.assertEqual(count, len(values(checked_permission='View')))
+      check(1)
+
+      for permission in 'View', 'Access contents information':
+        address.manage_permission(permission, roles=(), acquire=0)
+        check(0)
+
 class TestAccessControl(ERP5TypeTestCase):
   # Isolate test in a dedicaced class in order not to break other tests
   # when this one fails.




More information about the Erp5-report mailing list