Commit 59eada14 authored by Julien Muchembled's avatar Julien Muchembled

testERP5Type: reset dynamic classes when list of property sheets changes on a portal type

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@42271 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent ab5d0d93
......@@ -690,7 +690,8 @@ class ERP5TypeTestCase(ProcessingNodeTestCase, PortalTestCase):
class_tool.importPropertySheet(property_sheet_name)
# We set the property sheet on the portal type
ti = self.getTypesTool().getTypeInfo(portal_type_name)
types_tool = self.getTypesTool()
ti = types_tool.getTypeInfo(portal_type_name)
property_sheet_set = set(ti.getTypePropertySheetList())
property_sheet_set.add(property_sheet_name)
ti._setTypePropertySheetList(list(property_sheet_set))
......@@ -699,7 +700,7 @@ class ERP5TypeTestCase(ProcessingNodeTestCase, PortalTestCase):
self._added_property_sheets.setdefault(
portal_type_name, []).append(property_sheet_name)
# reset aq_dynamic cache
_aq_reset()
types_tool.resetDynamicDocuments()
def getRule(self, **kw):
return self.portal.portal_rules.searchFolder(
......
......@@ -69,7 +69,6 @@ class PropertySheetTestCase(ERP5TypeTestCase):
"""Clean up """
transaction.abort()
ttool = self.getTypesTool()
class_tool = self.getClassTool()
# remove all property sheet we added to type informations
for ti_name, psheet_list in self._added_property_sheets.items():
ti = ttool.getTypeInfo(ti_name)
......@@ -82,7 +81,7 @@ class PropertySheetTestCase(ERP5TypeTestCase):
removeLocalPropertySheet(psheet)
ti._setTypePropertySheetList(list(property_sheet_set))
transaction.commit()
_aq_reset()
ttool.resetDynamicDocuments()
ERP5TypeTestCase.tearDown(self)
def _addProperty(self, portal_type_name, property_definition_code):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment