From de80dc2ee5d40f608bde72ab5a74db5bb9d2e62d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C5=81ukasz=20Nowak?= <luke@nexedi.com>
Date: Thu, 17 Feb 2011 10:22:29 +0000
Subject: [PATCH]  - check that propertyMap for ERP5 type is returning unique
 list of    property ids

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@43407 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 product/ERP5Type/tests/testERP5Type.py | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/product/ERP5Type/tests/testERP5Type.py b/product/ERP5Type/tests/testERP5Type.py
index 2ead354a09..aae135a4a4 100644
--- a/product/ERP5Type/tests/testERP5Type.py
+++ b/product/ERP5Type/tests/testERP5Type.py
@@ -3050,6 +3050,17 @@ class TestERP5Type(PropertySheetTestCase, LogInterceptor):
         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.
-- 
2.30.9