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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
iv
erp5
Commits
90a8918e
Commit
90a8918e
authored
Aug 18, 2016
by
iv
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ERP5Workflow: fix testERP5Workflow to use categories for after/before scripts
parent
51154039
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
9 deletions
+8
-9
product/ERP5Workflow/tests/testERP5Workflow.py
product/ERP5Workflow/tests/testERP5Workflow.py
+8
-9
No files found.
product/ERP5Workflow/tests/testERP5Workflow.py
View file @
90a8918e
...
@@ -152,9 +152,7 @@ class TestERP5Workflow(ERP5TypeTestCase):
...
@@ -152,9 +152,7 @@ class TestERP5Workflow(ERP5TypeTestCase):
title
=
'State 2'
)
title
=
'State 2'
)
s1
.
setReference
(
's1'
)
s1
.
setReference
(
's1'
)
s2
.
setReference
(
's2'
)
s2
.
setReference
(
's2'
)
t1
=
workflow
.
newContent
(
portal_type
=
'Transition'
,
t1
=
workflow
.
newContent
(
portal_type
=
'Transition'
,
title
=
'Transition 1'
)
title
=
'Transition 1'
,
after_script_id
=
'Document_testAfterScript'
)
t1
.
setReference
(
't1'
)
t1
.
setReference
(
't1'
)
s1
.
setDestinationValue
(
t1
)
s1
.
setDestinationValue
(
t1
)
t1
.
setDestinationValue
(
s2
)
t1
.
setDestinationValue
(
s2
)
...
@@ -165,6 +163,9 @@ class TestERP5Workflow(ERP5TypeTestCase):
...
@@ -165,6 +163,9 @@ class TestERP5Workflow(ERP5TypeTestCase):
script
.
setParameterSignature
(
"state_change"
)
script
.
setParameterSignature
(
"state_change"
)
script
.
setBody
(
"state_change['object'].setDescription('After script was "
+
script
.
setBody
(
"state_change['object'].setDescription('After script was "
+
"executed.')"
)
"executed.')"
)
t1
.
setCategoryList
(
t1
.
getCategoryList
()
+
[
'after_script/'
+
script
.
getRelativeUrl
()])
self
.
getPortalObject
().
portal_types
.
_getOb
(
'Folder'
)
\
self
.
getPortalObject
().
portal_types
.
_getOb
(
'Folder'
)
\
.
edit
(
type_workflow_list
=
(
'wf'
))
.
edit
(
type_workflow_list
=
(
'wf'
))
doc
=
self
.
portal
.
newContent
(
portal_type
=
'Folder'
,
id
=
'test_doc'
)
doc
=
self
.
portal
.
newContent
(
portal_type
=
'Folder'
,
id
=
'test_doc'
)
...
@@ -174,7 +175,7 @@ class TestERP5Workflow(ERP5TypeTestCase):
...
@@ -174,7 +175,7 @@ class TestERP5Workflow(ERP5TypeTestCase):
# FIXME: not passing parameter to an after script is probably too
# FIXME: not passing parameter to an after script is probably too
# restrictive
# restrictive
def
test_
B
eforeScript
(
self
):
def
test_
b
eforeScript
(
self
):
workflow
=
self
.
workflow_module
.
newContent
(
workflow
=
self
.
workflow_module
.
newContent
(
portal_type
=
'Workflow'
)
portal_type
=
'Workflow'
)
workflow
.
setReference
(
'wf'
)
workflow
.
setReference
(
'wf'
)
...
@@ -185,10 +186,7 @@ class TestERP5Workflow(ERP5TypeTestCase):
...
@@ -185,10 +186,7 @@ class TestERP5Workflow(ERP5TypeTestCase):
title
=
'State 2'
)
title
=
'State 2'
)
s1
.
setReference
(
's1'
)
s1
.
setReference
(
's1'
)
s2
.
setReference
(
's2'
)
s2
.
setReference
(
's2'
)
t1
=
workflow
.
newContent
(
portal_type
=
'Transition'
,
t1
=
workflow
.
newContent
(
portal_type
=
'Transition'
,
title
=
'Transition 1'
)
title
=
'Transition 1'
,
before_script_id
=
'Document_testBeforeScript'
,
)
t1
.
setReference
(
't1'
)
t1
.
setReference
(
't1'
)
s1
.
setDestinationValue
(
t1
)
s1
.
setDestinationValue
(
t1
)
t1
.
setDestinationValue
(
s2
)
t1
.
setDestinationValue
(
s2
)
...
@@ -198,7 +196,8 @@ class TestERP5Workflow(ERP5TypeTestCase):
...
@@ -198,7 +196,8 @@ class TestERP5Workflow(ERP5TypeTestCase):
script
.
setParameterSignature
(
"state_change"
)
script
.
setParameterSignature
(
"state_change"
)
script
.
setBody
(
"state_change['object'].setDescription('Before script was "
+
script
.
setBody
(
"state_change['object'].setDescription('Before script was "
+
"executed.')"
)
"executed.')"
)
t1
.
setCategoryList
(
t1
.
getCategoryList
()
+
[
'before_script/'
+
script
.
getRelativeUrl
()])
self
.
getPortalObject
().
portal_types
.
_getOb
(
'Folder'
)
\
self
.
getPortalObject
().
portal_types
.
_getOb
(
'Folder'
)
\
.
edit
(
type_workflow_list
=
(
'wf'
))
.
edit
(
type_workflow_list
=
(
'wf'
))
doc
=
self
.
portal
.
newContent
(
portal_type
=
'Folder'
,
id
=
'test_doc'
)
doc
=
self
.
portal
.
newContent
(
portal_type
=
'Folder'
,
id
=
'test_doc'
)
...
...
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