Skip to content

Commit

Permalink
[UPD] Test coverage increased
Browse files Browse the repository at this point in the history
  • Loading branch information
Adrià Pallejà committed Mar 4, 2024
1 parent fe8e294 commit fa553e6
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions crm_lead_product/tests/test_crm_lead_line.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,27 +117,34 @@ def test_01_lead_lines(self):
"Lead line product template should be equal " "to None",
)

# Don't define lead id and shouldn't be defined product template neither price unit
# Don't define lead id and shouldn't be defined product template neither
lead_line_5 = self.lead_line_obj.create(
{
"name": self.product_1.name,
"product_id": self.product_1.id,
"uom_id": self.product_1.uom_id.id,
}
)

lead_line_5._onchange_product_id()
lead_line_5._onchange_product_tmpl_id()
lead_line_5._onchange_uom_id()

self.assertNotEqual(
lead_line_5.product_tmpl_id,
self.product_1.product_tmpl_id,
"Lead line product template should be equal to None",
)

# Computes lead line price unit
computed_price = self.product_1.uom_id._compute_price(
self.product_1.list_price, self.product_1.uom_id
)

self.assertEqual(
lead_line_5.price_unit,
0.0,
"Lead line price unit should be equal to 0",
computed_price,
"Lead line price unit should be equal to computed price",
)

def test_02_lead_to_opportunity(self):
Expand Down

0 comments on commit fa553e6

Please sign in to comment.