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
Carlos Ramos Carreño
erp5
Commits
0acc604f
Commit
0acc604f
authored
Mar 16, 2023
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
testDynamicClassGeneration WIP
parent
feffa8e4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
10 deletions
+10
-10
product/ERP5Type/tests/testDynamicClassGeneration.py
product/ERP5Type/tests/testDynamicClassGeneration.py
+10
-10
No files found.
product/ERP5Type/tests/testDynamicClassGeneration.py
View file @
0acc604f
...
...
@@ -2819,8 +2819,8 @@ class TestWithImport(TestImported):
from ITestGC import ITestGC
import zope.interface
@zope.interface.implementer(ITestGC)
class TestGC(XMLObject):
zope.interface.implements(ITestGC)
def foo(self):
pass
"""
)
...
...
@@ -2939,11 +2939,11 @@ from erp5.component.document.Person import Person
from ITestPortalType import ITestPortalType
import zope.interface
zope.interface.implementer(ITestPortalType)
class TestPortalType(Person):
def test42(self):
return 42
zope.interface.implements(ITestPortalType)
def foo(self):
pass
"""
)
...
...
@@ -3135,7 +3135,7 @@ InitializeClass(%(class_name)s)
'%s/manage_addProduct/ERP5/manage_addToolForm'
%
self
.
portal
.
getPath
(),
'ERP5TypeTestCase:'
)
self
.
assertEqual
(
response
.
getStatus
(),
200
)
self
.
assertNotIn
(
'ERP5 Test Hook After Load Tool'
,
response
.
getBody
())
self
.
assertNotIn
(
b
'ERP5 Test Hook After Load Tool'
,
response
.
getBody
())
component
.
validate
()
self
.
tic
()
...
...
@@ -3147,7 +3147,7 @@ InitializeClass(%(class_name)s)
'%s/manage_addProduct/ERP5/manage_addToolForm'
%
self
.
portal
.
getPath
(),
'ERP5TypeTestCase:'
)
self
.
assertEqual
(
response
.
getStatus
(),
200
)
self
.
assertIn
(
'ERP5 Test Hook After Load Tool'
,
response
.
getBody
())
self
.
assertIn
(
b
'ERP5 Test Hook After Load Tool'
,
response
.
getBody
())
from
Products.ERP5Type.Core.TestComponent
import
TestComponent
...
...
@@ -3371,9 +3371,9 @@ ImportError: No module named non.existing.module
name
=
self
.
_testMethodName
types_tool
=
self
.
portal
.
portal_types
ptype
=
types_tool
.
newContent
(
name
,
type_class
=
"File"
,
portal_type
=
'Base Type'
)
file
=
ptype
.
constructInstance
(
self
.
portal
,
name
,
data
=
"foo"
)
file
=
ptype
.
constructInstance
(
self
.
portal
,
name
,
data
=
b
"foo"
)
file_uid
=
file
.
getUid
()
self
.
assertEqual
(
file
.
size
,
len
(
"foo"
))
self
.
assertEqual
(
file
.
size
,
len
(
b
"foo"
))
self
.
commit
()
try
:
self
.
portal
.
_p_jar
.
cacheMinimize
()
...
...
@@ -3389,7 +3389,7 @@ ImportError: No module named non.existing.module
# Check that the class is unghosted before resolving __setattr__
self
.
assertRaises
(
BrokenModified
,
setattr
,
file
,
"size"
,
0
)
self
.
assertIsInstance
(
file
,
ERP5BaseBroken
)
self
.
assertEqual
(
file
.
size
,
len
(
"foo"
))
self
.
assertEqual
(
file
.
size
,
len
(
b
"foo"
))
# Now if we repair the portal type definition, instances will
# no longer be broken and be modifiable again.
...
...
@@ -3399,9 +3399,9 @@ ImportError: No module named non.existing.module
file
=
self
.
portal
[
name
]
self
.
assertNotIsInstance
(
file
,
ERP5BaseBroken
)
self
.
assertEqual
(
file
.
getUid
(),
file_uid
)
self
.
assertEqual
(
file
.
getData
(),
"foo"
)
file
.
setData
(
"something else"
)
self
.
assertEqual
(
file
.
getData
(),
"something else"
)
self
.
assertEqual
(
file
.
getData
(),
b
"foo"
)
file
.
setData
(
b
"something else"
)
self
.
assertEqual
(
file
.
getData
(),
b
"something else"
)
self
.
assertNotIn
(
"__Broken_state__"
,
file
.
__dict__
)
finally
:
self
.
portal
.
_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