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
Yusei Tahara
erp5
Commits
b3c79a51
Commit
b3c79a51
authored
Feb 28, 2012
by
Arnaud Fontaine
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cosmetic.
parent
fcf1d15c
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
10 deletions
+8
-10
product/ERP5Type/tests/testDynamicClassGeneration.py
product/ERP5Type/tests/testDynamicClassGeneration.py
+8
-10
No files found.
product/ERP5Type/tests/testDynamicClassGeneration.py
View file @
b3c79a51
...
@@ -1242,9 +1242,7 @@ class _TestZodbComponent(SecurityTestCase):
...
@@ -1242,9 +1242,7 @@ class _TestZodbComponent(SecurityTestCase):
elif
'ERP5TypeTestCase'
not
in
product_config
[
'erp5'
].
developer_list
:
elif
'ERP5TypeTestCase'
not
in
product_config
[
'erp5'
].
developer_list
:
product_config
[
'erp5'
].
developer_list
.
append
(
'ERP5TypeTestCase'
)
product_config
[
'erp5'
].
developer_list
.
append
(
'ERP5TypeTestCase'
)
self
.
_component_tool
=
self
.
getPortal
().
portal_components
self
.
_portal
=
self
.
getPortal
()
self
.
_component_tool
=
self
.
_portal
.
portal_components
self
.
_module
=
__import__
(
self
.
_getComponentModuleName
(),
self
.
_module
=
__import__
(
self
.
_getComponentModuleName
(),
fromlist
=
[
'erp5.component'
])
fromlist
=
[
'erp5.component'
])
self
.
_component_tool
.
reset
()
self
.
_component_tool
.
reset
()
...
@@ -1680,7 +1678,7 @@ class TestZodbExtensionComponent(_TestZodbComponent):
...
@@ -1680,7 +1678,7 @@ class TestZodbExtensionComponent(_TestZodbComponent):
# Add an External Method using the Extension Component defined above and
# Add an External Method using the Extension Component defined above and
# check that it returns 42
# check that it returns 42
from
Products.ExternalMethod.ExternalMethod
import
manage_addExternalMethod
from
Products.ExternalMethod.ExternalMethod
import
manage_addExternalMethod
manage_addExternalMethod
(
self
.
_portal
,
manage_addExternalMethod
(
self
.
getPortal
()
,
'TestExternalMethod'
,
'TestExternalMethod'
,
'title'
,
'title'
,
'TestExternalMethodComponent'
,
'TestExternalMethodComponent'
,
...
@@ -1689,18 +1687,18 @@ class TestZodbExtensionComponent(_TestZodbComponent):
...
@@ -1689,18 +1687,18 @@ class TestZodbExtensionComponent(_TestZodbComponent):
transaction
.
commit
()
transaction
.
commit
()
self
.
tic
()
self
.
tic
()
external_method
=
self
.
_portal
.
TestExternalMethod
external_method
=
self
.
getPortal
()
.
TestExternalMethod
self
.
assertEqual
(
external_method
(),
42
)
self
.
assertEqual
(
external_method
(),
42
)
# Add a Python Script with the External Method defined above and check
# Add a Python Script with the External Method defined above and check
# that it returns 42
# that it returns 42
from
Products.PythonScripts.PythonScript
import
manage_addPythonScript
from
Products.PythonScripts.PythonScript
import
manage_addPythonScript
manage_addPythonScript
(
self
.
_portal
,
'TestPythonScript'
)
manage_addPythonScript
(
self
.
getPortal
()
,
'TestPythonScript'
)
self
.
_portal
.
TestPythonScript
.
write
(
'return context.TestExternalMethod()'
)
self
.
getPortal
()
.
TestPythonScript
.
write
(
'return context.TestExternalMethod()'
)
transaction
.
commit
()
transaction
.
commit
()
self
.
tic
()
self
.
tic
()
self
.
assertEqual
(
self
.
_portal
.
TestPythonScript
(),
42
)
self
.
assertEqual
(
self
.
getPortal
()
.
TestPythonScript
(),
42
)
# Invalidate the Extension Component
# Invalidate the Extension Component
test_component
.
invalidate
()
test_component
.
invalidate
()
...
@@ -1758,12 +1756,12 @@ class TestPortalType(Person):
...
@@ -1758,12 +1756,12 @@ class TestPortalType(Person):
# be available
# be available
self
.
assertModuleImportable
(
'TestPortalType'
)
self
.
assertModuleImportable
(
'TestPortalType'
)
person_type
=
self
.
_portal
.
portal_types
.
Person
person_type
=
self
.
getPortal
()
.
portal_types
.
Person
person_type_class
=
person_type
.
getTypeClass
()
person_type_class
=
person_type
.
getTypeClass
()
self
.
assertEquals
(
person_type_class
,
'Person'
)
self
.
assertEquals
(
person_type_class
,
'Person'
)
# Create a new Person
# Create a new Person
person_module
=
self
.
_portal
.
person_module
person_module
=
self
.
getPortal
()
.
person_module
person
=
person_module
.
newContent
(
id
=
'Foo Bar'
,
portal_type
=
'Person'
)
person
=
person_module
.
newContent
(
id
=
'Foo Bar'
,
portal_type
=
'Person'
)
self
.
assertTrue
(
PersonDocument
in
person
.
__class__
.
mro
())
self
.
assertTrue
(
PersonDocument
in
person
.
__class__
.
mro
())
...
...
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