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
Levin Zimmermann
erp5
Commits
edf83677
Commit
edf83677
authored
Oct 26, 2011
by
Yusei Tahara
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add a test and make sure that split and defer works after accept decision.
parent
82115e56
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
65 additions
and
0 deletions
+65
-0
product/ERP5/tests/testERP5Simulation.py
product/ERP5/tests/testERP5Simulation.py
+65
-0
No files found.
product/ERP5/tests/testERP5Simulation.py
View file @
edf83677
...
...
@@ -208,3 +208,68 @@ class TestERP5Simulation(TestPackingListMixin, ERP5TypeTestCase):
sequence_list
.
addSequenceString
(
sequence_string
)
sequence_list
.
play
(
self
,
quiet
=
quiet
)
def
stepIncreasePackingListLineQuantity1000
(
self
,
sequence
=
None
,
sequence_list
=
None
,
**
kw
):
self
.
_modifyPackingListLineQuantity
(
sequence
,
sequence_list
,
1000.0
)
def
stepCheckPackingListSplittedForTest02
(
self
,
sequence
=
None
,
sequence_list
=
None
,
**
kw
):
"""
Test if packing list was splitted
"""
order
=
sequence
.
get
(
'order'
)
packing_list_list
=
order
.
getCausalityRelatedValueList
(
portal_type
=
self
.
packing_list_portal_type
)
self
.
assertEquals
(
2
,
len
(
packing_list_list
))
packing_list1
=
None
packing_list2
=
None
for
packing_list
in
packing_list_list
:
if
packing_list
.
getUid
()
==
sequence
.
get
(
'packing_list'
).
getUid
():
packing_list1
=
packing_list
else
:
packing_list2
=
packing_list
sequence
.
edit
(
new_packing_list
=
packing_list2
)
for
line
in
packing_list1
.
objectValues
(
portal_type
=
self
.
packing_list_line_portal_type
):
self
.
assertEquals
(
self
.
default_quantity
-
10
,
line
.
getQuantity
())
for
line
in
packing_list2
.
objectValues
(
portal_type
=
self
.
packing_list_line_portal_type
):
self
.
assertEquals
(
10
+
1000
,
line
.
getQuantity
())
def
test_02_splitAndDeferAfterAcceptDecision
(
self
,
quiet
=
quiet
,
run
=
run_all_test
):
"""
Change the quantity on an delivery line, then
see if the packing list is divergent and then
accept decision, then change the quantity again
and see if the packing list is divergent and then
split and defer the packing list and then see
if two packing lists has correct quantity and
they are not diverged.
"""
if
not
run
:
return
sequence_list
=
SequenceList
()
# Test with a simply order without cell
sequence_string
=
self
.
default_sequence
+
'
\
stepIncreasePackingListLineQuantity1000
\
stepCheckPackingListIsCalculating
\
stepTic
\
stepCheckPackingListIsDiverged
\
stepAcceptDecisionQuantity
\
stepCheckPackingListIsCalculating
\
stepTic
\
stepCheckPackingListIsNotDivergent
\
stepCheckPackingListIsSolved
\
stepDecreasePackingListLineQuantity10
\
stepCheckPackingListIsCalculating
\
stepTic
\
stepCheckPackingListIsDiverged
\
stepSplitAndDeferPackingList
\
stepCheckSolverIsSolving
\
stepTic
\
stepCheckPackingListSplittedForTest02
\
stepCheckPackingListIsSolved
\
stepCheckSolverIsSolved
\
'
sequence_list
.
addSequenceString
(
sequence_string
)
sequence_list
.
play
(
self
,
quiet
=
quiet
)
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