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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Eteri
erp5
Commits
e9630ba1
Commit
e9630ba1
authored
Nov 27, 2014
by
wenjie.zheng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_core: Deploy workflow_list to access Workflow5 in testERP5Workflow
parent
0b06ab6e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
14 deletions
+19
-14
product/ERP5/bootstrap/erp5_core/TestTemplateItem/portal_components/test.erp5.testERP5Workflow.py
...plateItem/portal_components/test.erp5.testERP5Workflow.py
+19
-14
No files found.
product/ERP5/bootstrap/erp5_core/TestTemplateItem/portal_components/test.erp5.testERP5Workflow.py
View file @
e9630ba1
...
...
@@ -67,9 +67,7 @@ class TestERP5Workflow(ERP5TypeTestCase):
def
test_Erp5Workflow
(
self
):
"""Tests the connection between ERP5Workflow and Objects."""
# Create base category as the intermidiate
self
.
portal
.
portal_categories
.
newContent
(
'category_state'
)
#self.portal.portal_categories.newContent('erp5_workflow')
# Create a workflow
new_workflow
=
self
.
workflow_module
.
newContent
(
portal_type
=
'Workflow'
,
...
...
@@ -97,6 +95,9 @@ class TestERP5Workflow(ERP5TypeTestCase):
type_object
.
setWorkflow5Value
(
new_workflow
)
#use variable in ERP5Type.py, to avoid using no-exist accessor
type_object
.
workflow_list
=
(
'new_workflow'
,)
self
.
assertEqual
(
type_object
.
getBaseCategoryList
(),
[
'workflow5'
])
self
.
assertEqual
(
type_object
.
getWorkflow5
(),
'workflow_module/new_workflow'
)
...
...
@@ -122,7 +123,6 @@ class TestERP5Workflow(ERP5TypeTestCase):
def
test_Erp5Transition
(
self
):
"""Tests ERP5Workflow transition"""
# Create base category as the intermidiate
self
.
portal
.
portal_categories
.
newContent
(
'category_state'
)
self
.
portal
.
portal_categories
.
newContent
(
'category_transition'
)
...
...
@@ -131,10 +131,12 @@ class TestERP5Workflow(ERP5TypeTestCase):
id
=
'new_workflow'
)
s1
=
new_workflow
.
newContent
(
portal_type
=
'State'
,
title
=
'State 1'
)
s2
=
new_workflow
.
newContent
(
portal_type
=
'State'
,
title
=
'State 2'
)
t1
=
new_workflow
.
newContent
(
portal_type
=
'Transition'
,
t1
=
new_workflow
.
newContent
(
portal_type
=
'Transition'
,
title
=
'Transition 1'
,
id
=
'transition1'
)
t2
=
new_workflow
.
newContent
(
portal_type
=
'Transition'
,
t2
=
new_workflow
.
newContent
(
portal_type
=
'Transition'
,
title
=
'Transition 2'
,
id
=
'transition2'
)
s1
.
setDestinationValue
(
t1
)
...
...
@@ -158,6 +160,7 @@ class TestERP5Workflow(ERP5TypeTestCase):
)
type_object
.
setWorkflow5Value
(
new_workflow
)
type_object
.
workflow_list
=
(
'new_workflow'
,)
self
.
assertEqual
(
type_object
.
getBaseCategoryList
(),
[
'workflow5'
])
self
.
assertEqual
(
type_object
.
getWorkflow5
(),
...
...
@@ -201,6 +204,8 @@ class TestERP5Workflow(ERP5TypeTestCase):
new_object
)
self
.
assertEqual
(
new_object
.
getCategoryStateTitle
(),
'State 1'
)
#new_object.transition1()
#self.assertEqual(new_object.getCategoryStateTitle(), 'State 2')
#new_object.transition2a1()
...
...
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