Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
E
erp5_rtl_support
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Romain Courteaud
erp5_rtl_support
Commits
e6f4e312
Commit
e6f4e312
authored
Jun 07, 2016
by
Julien Muchembled
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
testDynamicClassGeneration: clean up objects created by testERP5Broken
This was breaking the next test.
parent
56af85cf
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
12 deletions
+18
-12
product/ERP5Type/tests/testDynamicClassGeneration.py
product/ERP5Type/tests/testDynamicClassGeneration.py
+18
-12
No files found.
product/ERP5Type/tests/testDynamicClassGeneration.py
View file @
e6f4e312
...
@@ -2251,21 +2251,27 @@ class Test(ERP5TypeTestCase):
...
@@ -2251,21 +2251,27 @@ 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()
self.portal._p_jar.cacheMinimize()
try:
del file
self.portal._p_jar.cacheMinimize()
delattr(erp5.portal_type, name)
del file
ptype.setTypeClass(name)
delattr(erp5.portal_type, name)
self.commit()
ptype.setTypeClass(name)
file = self.portal.__dict__[name]
self.commit()
self.assertTrue(isinstance(file, InitGhostBase))
file = self.portal.__dict__[name]
# Check that the class is unghosted before resolving __setattr__
self.assertTrue(isinstance(file, InitGhostBase))
self.assertRaises(BrokenModified, setattr, file, "size", 0)
# Check that the class is unghosted before resolving __setattr__
self.assertTrue(isinstance(file, ERP5BaseBroken))
self.assertRaises(BrokenModified, setattr, file, "size", 0)
self.assertEqual(file.size, 3)
self.assertTrue(isinstance(file, ERP5BaseBroken))
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()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment