Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Léo-Paul Géneau
erp5
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):
# Create a broken ghost object
import erp5.portal_type
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")
self.assertEqual(file.size, 3)
self.commit()
self.portal._p_jar.cacheMinimize()
del file
delattr(erp5.portal_type, name)
ptype.setTypeClass(name)
self.commit()
file = self.portal.__dict__[name]
self.assertTrue(isinstance(file, InitGhostBase))
# Check that the class is unghosted before resolving __setattr__
self.assertRaises(BrokenModified, setattr, file, "size", 0)
self.assertTrue(isinstance(file, ERP5BaseBroken))
self.assertEqual(file.size, 3)
try:
self.portal._p_jar.cacheMinimize()
del file
delattr(erp5.portal_type, name)
ptype.setTypeClass(name)
self.commit()
file = self.portal.__dict__[name]
self.assertTrue(isinstance(file, InitGhostBase))
# Check that the class is unghosted before resolving __setattr__
self.assertRaises(BrokenModified, setattr, file, "size", 0)
self.assertTrue(isinstance(file, ERP5BaseBroken))
self.assertEqual(file.size, 3)
finally:
self.portal._delObject(name)
types_tool._delObject(name)
self.commit()
def test_suite():
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