Commit dba15781 authored by Romain Courteaud's avatar Romain Courteaud

Remove objects created by the unit tests after each execution

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@35500 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 08cf5fb2
...@@ -53,6 +53,38 @@ class TestProxyField(ERP5TypeTestCase): ...@@ -53,6 +53,38 @@ class TestProxyField(ERP5TypeTestCase):
self.getPortal().portal_skins.changeSkin(skin_name) self.getPortal().portal_skins.changeSkin(skin_name)
request.set('portal_skin', skin_name) request.set('portal_skin', skin_name)
def beforeTearDown(self):
"""Remove objects created in tests."""
# Remove forms
custom_folder = self.getSkinsTool().custom
custom_folder.manage_delObjects(custom_folder.objectIds())
# Remove skin folders
if 'erp5_geek' in self.getSkinsTool().objectIds():
self.getSkinsTool().manage_delObjects(['erp5_geek'])
ps = self.getSkinsTool()
for skin_name, selection in ps.getSkinPaths():
new_selection = []
selection = selection.split(',')
for skin_id in selection:
if skin_id != 'erp5_geek':
new_selection.append(skin_id)
ps.manage_skinLayers(skinpath=tuple(new_selection),
skinname=skin_name, add_skin=1)
if 'customized_geek' in self.getSkinsTool().objectIds():
self.getSkinsTool().manage_delObjects(['customized_geek'])
ps = self.getSkinsTool()
for skin_name, selection in ps.getSkinPaths():
new_selection = []
selection = selection.split(',')
for skin_id in selection:
if skin_id != 'customized_geek':
new_selection.append(skin_id)
ps.manage_skinLayers(skinpath=tuple(new_selection),
skinname=skin_name, add_skin=1)
transaction.commit()
def testEmptySurchargedFieldLibrary(self): def testEmptySurchargedFieldLibrary(self):
""" """
This test checks that it is not required to duplicate all fields in a custom This test checks that it is not required to duplicate all fields in a custom
......
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