Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Pole-Web
Website
Commits
cbdbf47f
Commit
cbdbf47f
authored
Mar 16, 2022
by
VAN ZUIJLEN Nils
Committed by
VAN ZUIJLEN Nils
Apr 28, 2022
Browse files
Fix test_get_final_price_contributor
parent
bb746a69
Changes
1
Hide whitespace changes
Inline
Side-by-side
boutique/tests/test_models.py
View file @
cbdbf47f
...
...
@@ -583,7 +583,12 @@ class OrderItemTest(OrderItemTestCase):
self
.
assertEqual
(
oi
.
get_price_contributor
(),
10
*
pack
.
price_contributor
)
def
test_get_final_price_contributor
(
self
)
->
None
:
"""Tests OrderItem.get_final_price for a contributor"""
"""
Tests OrderItem.get_final_price for a contributor
It does not make sense to test with a cotiz item, as it cannot be added
to the cart.
"""
item
=
self
.
create_item
()
Contributor
.
take_half_contribution
(
self
.
user
,
"cash"
)
oi
=
OrderItemTest
.
create_orderitem
(
self
.
order
,
item
)
...
...
@@ -595,16 +600,6 @@ class OrderItemTest(OrderItemTestCase):
oi
.
refresh_from_db
()
self
.
assertEqual
(
oi
.
get_final_price
(),
oi
.
get_price_contributor
())
cotiz
=
self
.
create_item
()
cotiz
.
action
=
"half_cotiz"
cotiz
.
save
()
cotiz
.
add_to_order
(
self
.
order
)
self
.
order
.
refresh_from_db
()
oi
.
refresh_from_db
()
self
.
assertEqual
(
oi
.
get_final_price
(),
oi
.
get_price_contributor
())
def
test_get_final_price_non_contributor
(
self
)
->
None
:
"""
Tests OrderItem.get_final_price for a non contributor
...
...
@@ -690,7 +685,9 @@ class OrderTest(PaymentTestCase, OrderItemTestCase):
def
test_contains_cotiz_packs
(
self
)
->
None
:
"""Tests that Order.contains_cotiz is able to detect cotiz in packs"""
pack
=
self
.
create_pack
()
pack
=
self
.
create_pack
()
# No cotiz in it
# Make a pack with a cotiz in it
cpack
=
self
.
create_item
()
cotiz
=
self
.
create_item
()
cotiz
.
action
=
"full_cotiz"
...
...
Write
Preview
Supports
Markdown
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