Commit cbdbf47f authored by VAN ZUIJLEN Nils's avatar VAN ZUIJLEN Nils Committed by VAN ZUIJLEN Nils
Browse files

Fix test_get_final_price_contributor

parent bb746a69
......@@ -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"
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment