Commit e6f4e312 authored by Julien Muchembled's avatar Julien Muchembled

testDynamicClassGeneration: clean up objects created by testERP5Broken

This was breaking the next test.
parent 56af85cf
...@@ -2251,10 +2251,12 @@ class Test(ERP5TypeTestCase): ...@@ -2251,10 +2251,12 @@ class Test(ERP5TypeTestCase):
# Create a broken ghost object # Create a broken ghost object
import erp5.portal_type import erp5.portal_type
name = self._testMethodName name = self._testMethodName
ptype = self.portal.portal_types.newContent(name, type_class="File") types_tool = self.portal.portal_types
ptype = types_tool.newContent(name, type_class="File")
file = ptype.constructInstance(self.portal, name, data="foo") file = ptype.constructInstance(self.portal, name, data="foo")
self.assertEqual(file.size, 3) self.assertEqual(file.size, 3)
self.commit() self.commit()
try:
self.portal._p_jar.cacheMinimize() self.portal._p_jar.cacheMinimize()
del file del file
delattr(erp5.portal_type, name) delattr(erp5.portal_type, name)
...@@ -2266,6 +2268,10 @@ class Test(ERP5TypeTestCase): ...@@ -2266,6 +2268,10 @@ class Test(ERP5TypeTestCase):
self.assertRaises(BrokenModified, setattr, file, "size", 0) self.assertRaises(BrokenModified, setattr, file, "size", 0)
self.assertTrue(isinstance(file, ERP5BaseBroken)) self.assertTrue(isinstance(file, ERP5BaseBroken))
self.assertEqual(file.size, 3) self.assertEqual(file.size, 3)
finally:
self.portal._delObject(name)
types_tool._delObject(name)
self.commit()
def test_suite(): def test_suite():
suite = unittest.TestSuite() suite = unittest.TestSuite()
......
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