From e0999427f4b9f87b0e7ec4c659634419f4298258 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9rome=20Perrin?= Date: Thu, 13 Jan 2022 19:00:29 +0900 Subject: [PATCH] CodingStyleTestCase: create real documents for test_DuplicateActions no need to create temp objects because anyway the transaction is aborted at the end of each test. This solve a problem that some APIs behave differently on temp objects and we don't really have use cases where we use actions on temp objects. For reference, the case which fail is an action with a TALES condition using a related accessor, the exact condition was: python: object.getAggregateRelated(portal_type="Implicit Item Movement") is not None --- product/ERP5Type/tests/CodingStyleTestCase.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/product/ERP5Type/tests/CodingStyleTestCase.py b/product/ERP5Type/tests/CodingStyleTestCase.py index 0ad01576c6d..52ea1d574a8 100644 --- a/product/ERP5Type/tests/CodingStyleTestCase.py +++ b/product/ERP5Type/tests/CodingStyleTestCase.py @@ -177,10 +177,8 @@ class CodingStyleTestCase(ERP5TypeTestCase): document, content_portal_type_list = findContentChain( self.portal, portal_type) for content_portal_type in content_portal_type_list: - document = document.newContent( - portal_type=content_portal_type, - temp_object=True, - ) + document = document.newContent(portal_type=content_portal_type) + for action_category, action_list in self.portal.portal_actions.listFilteredActionsFor( document).iteritems(): # We ignore duplicate actions in action categories used by OfficeJS -- 2.25.1