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
Laurent S
erp5
Commits
7cce6cde
Commit
7cce6cde
authored
May 13, 2015
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test: add an edge case test for getPrice when the movement has an invalidated trade condition
parent
3759047d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
0 deletions
+34
-0
product/ERP5/tests/testTradeCondition.py
product/ERP5/tests/testTradeCondition.py
+34
-0
No files found.
product/ERP5/tests/testTradeCondition.py
View file @
7cce6cde
...
@@ -446,6 +446,40 @@ class TestTradeConditionSupplyLine(TradeConditionTestCase):
...
@@ -446,6 +446,40 @@ class TestTradeConditionSupplyLine(TradeConditionTestCase):
# not using the supply line inside trade condition
# not using the supply line inside trade condition
self
.
assertEqual
(
1
,
line
.
getPrice
())
self
.
assertEqual
(
1
,
line
.
getPrice
())
def
test_supply_line_in_invalidated_trade_condition_with_reference_does_not_apply
(
self
):
# edge case derived from
# test_supply_line_in_invalidated_trade_condition_does_not_apply, if a
# trade condition have a reference and is invalidated, composition
# mechanism will lookup another applicable trade condition, which can fail,
# but this should not affect getPrice
other_supply
=
self
.
portal
.
getDefaultModule
(
self
.
supply_type
).
newContent
(
portal_type
=
self
.
supply_type
,
resource_value
=
self
.
resource
,
source_section_value
=
self
.
vendor
,
destination_section_value
=
self
.
client
)
other_supply
.
validate
()
other_supply_line
=
other_supply
.
newContent
(
portal_type
=
self
.
supply_line_type
,
base_price
=
1
)
self
.
trade_condition
.
setReference
(
self
.
id
())
supply_line
=
self
.
trade_condition
.
newContent
(
portal_type
=
self
.
supply_line_type
,
resource_value
=
self
.
resource
,
base_price
=
2
)
self
.
order
.
setSpecialiseValue
(
self
.
trade_condition
)
self
.
order
.
setSourceSectionValue
(
self
.
vendor
)
self
.
order
.
setDestinationSectionValue
(
self
.
client
)
self
.
trade_condition
.
invalidate
()
self
.
tic
()
line
=
self
.
order
.
newContent
(
portal_type
=
self
.
order_line_type
,
resource_value
=
self
.
resource
,
quantity
=
1
)
# not using the supply line inside trade condition
self
.
assertEqual
(
1
,
line
.
getPrice
())
# TODO: move to testSupplyLine ! (which does not exist yet)
# TODO: move to testSupplyLine ! (which does not exist yet)
def
test_supply_line_section
(
self
):
def
test_supply_line_section
(
self
):
# if a supply lines defines a section, it has priority over supply lines
# if a supply lines defines a section, it has priority over supply lines
...
...
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