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
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Rafael Monnerat
erp5
Commits
e4a52743
Commit
e4a52743
authored
Aug 26, 2020
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
testDynamicClassGeneration: more self-explanatory assertions
parent
bc67c2c4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
4 deletions
+7
-4
product/ERP5Type/tests/testDynamicClassGeneration.py
product/ERP5Type/tests/testDynamicClassGeneration.py
+7
-4
No files found.
product/ERP5Type/tests/testDynamicClassGeneration.py
View file @
e4a52743
...
...
@@ -3035,20 +3035,23 @@ class Test(ERP5TypeTestCase):
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.assertEqual(file.size,
len("foo")
)
self.commit()
try:
self.portal._p_jar.cacheMinimize()
del file
delattr(erp5.portal_type, name)
# Simulate a portal type using a non existing class.
# Instances of this portal type are broken and can not be modified.
ptype.setTypeClass(name)
self.commit()
file = self.portal.__dict__[name]
self.assert
True(isinstance(file, InitGhostBase)
)
self.assert
IsInstance(file, InitGhostBase
)
# Check that the class is unghosted before resolving __setattr__
self.assertRaises(BrokenModified, setattr, file, "size", 0)
self.assert
True(isinstance(file, ERP5BaseBroken)
)
self.assertEqual(file.size,
3
)
self.assert
IsInstance(file, ERP5BaseBroken
)
self.assertEqual(file.size,
len("foo")
)
finally:
self.portal._delObject(name)
types_tool._delObject(name)
...
...
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