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

nobody at svn.erp5.org nobody at svn.erp5.org
Thu Feb 17 11:22:29 CET 2011


Author: luke
Date: Thu Feb 17 11:22:29 2011
New Revision: 43407

URL: http://svn.erp5.org?rev=43407&view=rev
Log:
 - check that propertyMap for ERP5 type is returning unique list of
   property ids

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=43407&r1=43406&r2=43407&view=diff
==============================================================================
--- erp5/trunk/products/ERP5Type/tests/testERP5Type.py [utf8] (original)
+++ erp5/trunk/products/ERP5Type/tests/testERP5Type.py [utf8] Thu Feb 17 11:22:29 2011
@@ -3050,6 +3050,17 @@ class TestERP5Type(PropertySheetTestCase
         if len(index_list):
           portal_actions.deleteActions(selections=index_list)
 
+    def test_propertyMap_unique_properties(self):
+      portal = self.getPortalObject()
+      person = portal.person_module.newContent(portal_type='Person')
+      property_id_dict = dict()
+      non_unique_property_id_list = []
+      for property_id in [p['id'] for p in person.propertyMap()]:
+        if property_id in property_id_dict:
+          non_unique_property_id_list.append(property_id)
+        property_id_dict[property_id] = 1
+      self.assertEqual([], non_unique_property_id_list)
+
 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