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
Labels
Merge Requests
7
Merge Requests
7
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
Jérome Perrin
erp5
Commits
67ad2b82
Commit
67ad2b82
authored
Mar 07, 2024
by
Kazuhiko Shiozaki
Committed by
Jérome Perrin
Apr 02, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
testMRP: use OrderableKey to sort list containing None and str.
parent
bb23e05d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
6 deletions
+7
-6
bt5/erp5_mrp/TestTemplateItem/portal_components/test.erp5.testMRP.py
...p/TestTemplateItem/portal_components/test.erp5.testMRP.py
+7
-6
No files found.
bt5/erp5_mrp/TestTemplateItem/portal_components/test.erp5.testMRP.py
View file @
67ad2b82
...
...
@@ -28,6 +28,7 @@
import
unittest
from
DateTime
import
DateTime
from
Products.ERP5Type.Utils
import
OrderableKey
from
erp5.component.test.testBPMCore
import
TestBPMMixin
from
six.moves
import
range
import
six
...
...
@@ -341,18 +342,18 @@ class TestMRPImplementation(TestMRPMixin):
reference
=
None
movement_list
.
append
((
sm
.
getTradePhase
(),
sm
.
getQuantity
(),
reference
,
sm
.
getIndustrialPhaseList
()))
movement_list
.
sort
()
self
.
assertEqual
(
movement_list
,
sorted
((
(
'mrp/manufacturing_step_0'
,
-
10.0
,
None
,
[]),
movement_list
.
sort
(
key
=
lambda
x
:
[
OrderableKey
(
e
)
for
e
in
x
])
self
.
assertEqual
(
movement_list
,
[
(
'mrp/manufacturing_step_0'
,
-
30.0
,
None
,
[]),
(
'mrp/manufacturing_step_0'
,
-
10.0
,
None
,
[]),
(
'mrp/manufacturing_step_0'
,
10.0
,
'pr/mrp/manufacturing_step_0'
,
[
'trade_phase/mrp/manufacturing_step_0'
]),
(
'mrp/manufacturing_step_1'
,
-
40.0
,
None
,
[]),
(
'mrp/manufacturing_step_1'
,
-
10.0
,
None
,
[]),
(
'mrp/manufacturing_step_1'
,
-
10.0
,
'cr/mrp/manufacturing_step_1'
,
[
'trade_phase/mrp/manufacturing_step_0'
]),
(
'mrp/manufacturing_step_1'
,
-
10.0
,
None
,
[]),
(
'mrp/manufacturing_step_1'
,
-
40.0
,
None
,
[]),
(
'mrp/manufacturing_step_1'
,
10.0
,
'pr'
,
[]),
))
)
]
)
order
.
confirm
()
# Build Manufacturing Order
...
...
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