From 8276c08a971505692533714e245a3b32a66a9952 Mon Sep 17 00:00:00 2001 From: Romain Courteaud <romain@nexedi.com> Date: Thu, 7 Feb 2008 10:55:13 +0000 Subject: [PATCH] Test getSimilarityCloud git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@19120 20353a03-c40f-0410-a6d1-a30d3c3de9de --- product/ERP5OOo/tests/testDms.py | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/product/ERP5OOo/tests/testDms.py b/product/ERP5OOo/tests/testDms.py index 0af26881d6..5767a06e83 100644 --- a/product/ERP5OOo/tests/testDms.py +++ b/product/ERP5OOo/tests/testDms.py @@ -346,7 +346,6 @@ class TestDocument(ERP5TypeTestCase, ZopeTestCase.Functional): """ if not run: return printAndLog('\nTest Explicit Relations') - raise NotImplementedError # create test documents: # (1) TEST, 002, en # (2) TEST, 003, en @@ -354,8 +353,25 @@ class TestDocument(ERP5TypeTestCase, ZopeTestCase.Functional): # (4) TWO, 001, en # (5) THREE, 001, en # set 3 similar to 1, 4 to 3, 5 to 4 - # getSimilarCloudValueList on 4 should return 2, 3 and 5 + # getSimilarCloudValueList on 4 should return 1, 3 and 5 # getSimilarCloudValueList(depth=1) on 4 should return 3 and 5 + document1 = self.portal.document_module.newContent() + document2 = self.portal.document_module.newContent() + document3 = self.portal.document_module.newContent() + document4 = self.portal.document_module.newContent() + document5 = self.portal.document_module.newContent() + + document3.setSimilarValue(document1) + document4.setSimilarValue(document3) + document5.setSimilarValue(document4) + + get_transaction().commit() + self.tic() + + self.assertSameSet([document1, document3, document5], + document4.getSimilarCloudValueList()) + self.assertSameSet([document3, document5], + document4.getSimilarCloudValueList(depth=1)) def test_07_testImplicitRelations(self,quiet=QUIET,run=RUN_ALL_TEST): """ -- 2.30.9