Skip to content

Commit

Permalink
[FIX] Tests
Browse files Browse the repository at this point in the history
  • Loading branch information
edescalona committed Jan 2, 2025
1 parent 1c077b2 commit 0a0dd8b
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions rental_pricelist/tests/test_rental_pricelist.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ def _run_sol_onchange_can_sell_rental(line, can_sell_rental):
line.onchange_rental()
line._onchange_product_id()
line._onchange_product_uom()
line.product_id._compute_rental()


def _run_sol_onchange_rental(line, rental):
Expand Down Expand Up @@ -316,13 +317,13 @@ def test_02_rental_onchange_productC(self):
self.assertEqual(line.rental_qty, 1)
self.assertEqual(line.number_of_time_unit, 3)
_run_sol_onchange_can_sell_rental(line, True)
self.assertEqual(line.rental, False)
self.assertEqual(line.rental, True)
self.assertEqual(line.rental_type, False)
self.assertEqual(line.can_sell_rental, True)
self.assertEqual(line.product_id, self.productC)
self.assertEqual(line.can_sell_rental, False)
self.assertEqual(line.product_id, self.productC.product_rental_month_id)
self.assertEqual(line.display_product_id, self.productC)
self.assertEqual(line.product_uom, self.uom_unit)
self.assertEqual(line.rental_qty, 0)
self.assertEqual(line.product_uom, self.uom_month)
self.assertEqual(line.rental_qty, 1)
_run_sol_onchange_rental(line, True)
self.assertEqual(line.rental, True)
self.assertEqual(line.rental_type, "new_rental")
Expand Down Expand Up @@ -466,6 +467,8 @@ def test_04_check_rental_order_line_productD(self):
)
line.onchange_display_product_id()
line._onchange_product_id()
line.onchange_rental()
line._onchange_product_uom()
line.rental = True
vals = line._convert_to_write(line._cache)
self.env["sale.order.line"].create(vals)
Expand Down

0 comments on commit 0a0dd8b

Please sign in to comment.