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
d810b3ef
Commit
d810b3ef
authored
Jun 17, 2016
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
interpolation
parent
218fc444
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
3 deletions
+17
-3
bt5/tmp_work/TestTemplateItem/portal_components/test.erp5.testInventoryAPI.py
...plateItem/portal_components/test.erp5.testInventoryAPI.py
+15
-2
product/ERP5/Tool/SimulationTool.py
product/ERP5/Tool/SimulationTool.py
+2
-1
No files found.
bt5/tmp_work/TestTemplateItem/portal_components/test.erp5.testInventoryAPI.py
View file @
d810b3ef
...
...
@@ -1260,6 +1260,19 @@ class TestInventory(InventoryAPITestCase):
interpolation_method
=
'all_or_nothing'
)
def
test_interpolation_method_invalid_input
(
self
):
# with interpolation method at least one of from_date, at_date or to_date is required.
with
self
.
assertRaises
(
ValueError
):
self
.
portal
.
portal_simulation
.
getInventoryList
(
interpolation_method
=
'linear'
)
with
self
.
assertRaises
(
ValueError
):
self
.
portal
.
portal_simulation
.
getInventoryList
(
interpolation_method
=
'all_or_nothing'
)
# XXX
with
self
.
assertRaises
(
ValueError
):
self
.
portal
.
portal_simulation
.
getInventoryList
(
interpolation_method
=
'one_for_all'
)
# XXX
class
TestInventoryList
(
InventoryAPITestCase
):
"""Tests getInventoryList methods.
"""
...
...
@@ -1837,7 +1850,7 @@ class TestInventoryList(InventoryAPITestCase):
# M1 XXXXXXXXXX
# M2 XXXXX
# M3 XXXXXXXXXX
# M4 XXXXX
# M4
XXXXX
# | | |
inventory_list
=
self
.
getSimulationTool
().
getInventoryList
(
...
...
@@ -1857,7 +1870,7 @@ class TestInventoryList(InventoryAPITestCase):
# ^^ 2 -> total for `node`: 5
# M3 XXXXXXXXXX
# ^^^^ 4 -> total for `other_node`: 4
# M4 XXXXX
# M4
XXXXX
# | [ | [ |
...
...
product/ERP5/Tool/SimulationTool.py
View file @
d810b3ef
...
...
@@ -648,7 +648,8 @@ class SimulationTool(BaseTool):
if
date_dict
:
column_value_dict
[
'date'
]
=
date_dict
if
interpolation_method
!=
'default'
:
assert
from_date
and
(
to_date
or
at_date
)
if
not
(
from_date
and
(
to_date
or
at_date
)):
raise
ValueError
(
"date_range is required to use interpolation_method"
)
# if we consider flow, we also select movement whose mirror date is
# in the from_date/to_date range and movement whose
# start_date/stop_date contains the report range.
...
...
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