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
Carlos Ramos Carreño
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 @@
...
@@ -28,6 +28,7 @@
import
unittest
import
unittest
from
DateTime
import
DateTime
from
DateTime
import
DateTime
from
Products.ERP5Type.Utils
import
OrderableKey
from
erp5.component.test.testBPMCore
import
TestBPMMixin
from
erp5.component.test.testBPMCore
import
TestBPMMixin
from
six.moves
import
range
from
six.moves
import
range
import
six
import
six
...
@@ -341,18 +342,18 @@ class TestMRPImplementation(TestMRPMixin):
...
@@ -341,18 +342,18 @@ class TestMRPImplementation(TestMRPMixin):
reference
=
None
reference
=
None
movement_list
.
append
((
sm
.
getTradePhase
(),
sm
.
getQuantity
(),
movement_list
.
append
((
sm
.
getTradePhase
(),
sm
.
getQuantity
(),
reference
,
sm
.
getIndustrialPhaseList
()))
reference
,
sm
.
getIndustrialPhaseList
()))
movement_list
.
sort
()
movement_list
.
sort
(
key
=
lambda
x
:
[
OrderableKey
(
e
)
for
e
in
x
])
self
.
assertEqual
(
movement_list
,
sorted
((
self
.
assertEqual
(
movement_list
,
[
(
'mrp/manufacturing_step_0'
,
-
10.0
,
None
,
[]),
(
'mrp/manufacturing_step_0'
,
-
30.0
,
None
,
[]),
(
'mrp/manufacturing_step_0'
,
-
30.0
,
None
,
[]),
(
'mrp/manufacturing_step_0'
,
-
10.0
,
None
,
[]),
(
'mrp/manufacturing_step_0'
,
10.0
,
(
'mrp/manufacturing_step_0'
,
10.0
,
'pr/mrp/manufacturing_step_0'
,
[
'trade_phase/mrp/manufacturing_step_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
,
(
'mrp/manufacturing_step_1'
,
-
10.0
,
'cr/mrp/manufacturing_step_1'
,
[
'trade_phase/mrp/manufacturing_step_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'
,
[]),
(
'mrp/manufacturing_step_1'
,
10.0
,
'pr'
,
[]),
))
)
]
)
order
.
confirm
()
order
.
confirm
()
# Build Manufacturing Order
# 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