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
Mikolaï Krol
erp5
Commits
425949fe
Commit
425949fe
authored
Dec 01, 2014
by
wenjie.zheng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_core: Change my testERP5Workflow's name to testWorkflow5.
parent
adce6926
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
22 additions
and
34 deletions
+22
-34
product/ERP5/bootstrap/erp5_core/TestTemplateItem/portal_components/test.erp5.testActivityTool.xml
...lateItem/portal_components/test.erp5.testActivityTool.xml
+0
-27
product/ERP5/bootstrap/erp5_core/TestTemplateItem/portal_components/test.erp5.testWorkflow5.py
...TemplateItem/portal_components/test.erp5.testWorkflow5.py
+16
-3
product/ERP5/bootstrap/erp5_core/TestTemplateItem/portal_components/test.erp5.testWorkflow5.xml
...emplateItem/portal_components/test.erp5.testWorkflow5.xml
+5
-3
product/ERP5/bootstrap/erp5_core/bt/template_test_id_list
product/ERP5/bootstrap/erp5_core/bt/template_test_id_list
+1
-1
No files found.
product/ERP5/bootstrap/erp5_core/TestTemplateItem/portal_components/test.erp5.testActivityTool.xml
View file @
425949fe
...
...
@@ -72,33 +72,6 @@
<key>
<string>
action
</string>
</key>
<value>
<string>
validate
</string>
</value>
</item>
<item>
<key>
<string>
actor
</string>
</key>
<value>
<string>
ERP5TypeTestCase
</string>
</value>
</item>
<item>
<key>
<string>
comment
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
time
</string>
</key>
<value>
<object>
<klass>
<global
name=
"DateTime"
module=
"DateTime.DateTime"
/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>
1377844421.32
</float>
<string>
GMT+9
</string>
</tuple>
</state>
</object>
</value>
</item>
<item>
<key>
<string>
validation_state
</string>
</key>
<value>
<string>
validated
</string>
</value>
...
...
product/ERP5/bootstrap/erp5_core/TestTemplateItem/portal_components/test.erp5.test
ERP5Workflow
.py
→
product/ERP5/bootstrap/erp5_core/TestTemplateItem/portal_components/test.erp5.test
Workflow5
.py
View file @
425949fe
...
...
@@ -28,6 +28,7 @@
import
unittest
from
Products.ERP5Type.tests.ERP5TypeTestCase
import
ERP5TypeTestCase
from
Acquisition
import
aq_get
class
TestERP5Workflow
(
ERP5TypeTestCase
):
"""
...
...
@@ -161,6 +162,7 @@ class TestERP5Workflow(ERP5TypeTestCase):
type_object
.
setWorkflow5Value
(
new_workflow
)
type_object
.
workflow_list
=
(
'new_workflow'
,)
#type_object.setProperty('Transition_2', new_workflow)
self
.
assertEqual
(
type_object
.
getBaseCategoryList
(),
[
'workflow5'
])
self
.
assertEqual
(
type_object
.
getWorkflow5
(),
...
...
@@ -179,22 +181,24 @@ class TestERP5Workflow(ERP5TypeTestCase):
# create an object based on new-created portal type in the module
new_object
=
self
.
portal
.
new_module
.
newContent
(
portal_type
=
'Object Type'
,
id
=
'new_object'
)
new_object
.
setCategoryTransitionValue
(
t2
)
self
.
assertTrue
(
new_object
is
not
None
)
self
.
assertEqual
(
new_object
.
getPortalType
(),
'Object Type'
)
self
.
assertEqual
(
new_object
.
getCategoryStateTitle
(),
'State 1'
)
# Pass transition
"""Method 1"""
# Method 1: transition level with base_category
t1
.
execute
(
new_object
)
self
.
assertEqual
(
new_object
.
getCategoryStateTitle
(),
'State 2'
)
t2
.
execute
(
new_object
)
self
.
assertEqual
(
new_object
.
getCategoryStateTitle
(),
'State 1'
)
"""Method 2"""
# Method 2: state level with base_category
s1
.
executeTransition
(
t1
,
new_object
)
self
.
assertEqual
(
new_object
.
getCategoryStateTitle
(),
'State 2'
)
s2
.
executeTransition
(
t2
,
new_object
)
self
.
assertEqual
(
new_object
.
getCategoryStateTitle
(),
'State 1'
)
"""Method 3"""
# Method 3: object level with base_category
new_object
.
getCategoryStateValue
().
executeTransition
(
new_workflow
.
transition1
,
new_object
)
...
...
@@ -204,6 +208,15 @@ class TestERP5Workflow(ERP5TypeTestCase):
new_object
)
self
.
assertEqual
(
new_object
.
getCategoryStateTitle
(),
'State 1'
)
# Method 4: object level with workflow_list
new_object
.
getDefaultModule
(
portal_type
=
"Workflow"
).
_getOb
(
'new_workflow'
).
transition1
.
execute
(
new_object
)
self
.
assertEqual
(
new_object
.
getCategoryStateTitle
(),
'State 2'
)
#new_object.getDefaultModule(portal_type="Workflow")._getOb('new_workflow').transition2.execute(new_object)
aq_get
(
new_object
,
'workflow_module'
,
1
).
_getOb
(
type_object
.
workflow_list
[
0
]).
transition2
.
execute
(
new_object
)
# getToolByName(new_object, 'new_workflow').transition2.execute(new_object) # marche pas
#new_object.Transition1.execute(new_object)
self
.
assertEqual
(
new_object
.
getCategoryStateTitle
(),
'State 1'
)
#new_object.transition1()
#self.assertEqual(new_object.getCategoryStateTitle(), 'State 2')
#new_object.transition2a1()
...
...
product/ERP5/bootstrap/erp5_core/TestTemplateItem/portal_components/test.erp5.test
ERP5Workflow
.xml
→
product/ERP5/bootstrap/erp5_core/TestTemplateItem/portal_components/test.erp5.test
Workflow5
.xml
View file @
425949fe
...
...
@@ -8,15 +8,17 @@
<dictionary>
<item>
<key>
<string>
default_reference
</string>
</key>
<value>
<string>
test
ERP5Workflow
</string>
</value>
<value>
<string>
test
Workflow5
</string>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<string>
Test ERP5 workflow
</string>
</value>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
test.erp5.test
ERP5Workflow
</string>
</value>
<value>
<string>
test.erp5.test
Workflow5
</string>
</value>
</item>
<item>
<key>
<string>
portal_type
</string>
</key>
...
...
product/ERP5/bootstrap/erp5_core/bt/template_test_id_list
View file @
425949fe
test.erp5.testActivityTool
test.erp5.testERP5Workflow
\ No newline at end of file
test.erp5.testWorkflow5
\ No newline at end of file
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