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
Mukul
erp5
Commits
27f6d782
Commit
27f6d782
authored
Sep 12, 2013
by
Mame Coumba Sall
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add test to make sure when we clone a task report, wf transitions are still available
parent
fcaad5a7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
38 additions
and
1 deletion
+38
-1
product/ERP5/tests/testTaskReportDivergence.py
product/ERP5/tests/testTaskReportDivergence.py
+38
-1
No files found.
product/ERP5/tests/testTaskReportDivergence.py
View file @
27f6d782
...
@@ -33,8 +33,9 @@ from Products.ERP5Type.tests.Sequence import SequenceList
...
@@ -33,8 +33,9 @@ from Products.ERP5Type.tests.Sequence import SequenceList
from
testTask
import
TestTaskMixin
from
testTask
import
TestTaskMixin
from
Products.ERP5Type.tests.backportUnittest
import
expectedFailure
from
Products.ERP5Type.tests.backportUnittest
import
expectedFailure
from
Products.ERP5.tests.utils
import
newSimulationExpectedFailure
from
Products.ERP5.tests.utils
import
newSimulationExpectedFailure
from
Products.ERP5Type.tests.SecurityTestCase
import
SecurityTestCase
class
TestTaskReportDivergenceMixin
(
TestTaskMixin
):
class
TestTaskReportDivergenceMixin
(
TestTaskMixin
,
SecurityTestCase
):
"""
"""
Test business template erp5_project
Test business template erp5_project
"""
"""
...
@@ -132,6 +133,25 @@ class TestTaskReportDivergenceMixin(TestTaskMixin):
...
@@ -132,6 +133,25 @@ class TestTaskReportDivergenceMixin(TestTaskMixin):
"""
"""
task_report
=
sequence
.
get
(
'task_report'
)
task_report
=
sequence
.
get
(
'task_report'
)
self
.
assertEquals
(
'foo'
,
task_report
.
getComment
())
self
.
assertEquals
(
'foo'
,
task_report
.
getComment
())
def
stepCloneTaskReportAndDoWfTransitions
(
self
,
sequence
=
None
,
**
kw
):
"""
Create a second task report by cloning the existing one.
"""
task_report
=
sequence
.
get
(
'task_report'
)
self
.
logout
()
self
.
login
(
'alex'
)
cloned_task_report
=
task_report
.
Base_createCloneDocument
(
batch_mode
=
1
)
self
.
tic
()
self
.
assertEquals
(
cloned_task_report
.
getCausalityState
(),
'draft'
)
self
.
assertEquals
(
cloned_task_report
.
getSimulationState
(),
'draft'
)
self
.
assertUserCanPassWorkflowTransition
(
'alex'
,
'confirm_action'
,
cloned_task_report
)
cloned_task_report
.
confirm
()
self
.
tic
()
self
.
assertEquals
(
cloned_task_report
.
getCausalityState
(),
'draft'
)
self
.
assertUserCanPassWorkflowTransition
(
'alex'
,
'start_action'
,
cloned_task_report
)
self
.
assertUserCanPassWorkflowTransition
(
'alex'
,
'stop_action'
,
cloned_task_report
)
class
TestTaskReportDivergence
(
TestTaskReportDivergenceMixin
,
ERP5TypeTestCase
)
:
class
TestTaskReportDivergence
(
TestTaskReportDivergenceMixin
,
ERP5TypeTestCase
)
:
...
@@ -323,6 +343,23 @@ class TestTaskReportDivergence(TestTaskReportDivergenceMixin, ERP5TypeTestCase)
...
@@ -323,6 +343,23 @@ class TestTaskReportDivergence(TestTaskReportDivergenceMixin, ERP5TypeTestCase)
sequence_list
.
play
(
self
,
quiet
=
quiet
)
sequence_list
.
play
(
self
,
quiet
=
quiet
)
def
test_05_ClonedTaskReportWorkflowEvolution
(
self
,
quiet
=
quiet
,
run
=
run_all_test
):
"""
"""
if
not
run
:
return
sequence_list
=
SequenceList
()
# Test with a simply order without cell
sequence_string
=
'
\
stepSetStrictSecurity
\
'
+
self
.
default_task_sequence
+
'
\
stepCheckTaskReportIsSolved
\
\
stepCloneTaskReportAndDoWfTransitions
\
'
sequence_list
.
addSequenceString
(
sequence_string
)
sequence_list
.
play
(
self
,
quiet
=
quiet
)
def
test_suite
():
def
test_suite
():
suite
=
unittest
.
TestSuite
()
suite
=
unittest
.
TestSuite
()
suite
.
addTest
(
unittest
.
makeSuite
(
TestTaskReportDivergence
))
suite
.
addTest
(
unittest
.
makeSuite
(
TestTaskReportDivergence
))
...
...
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