From 54c62fed690c26835c64f0dedd1d17cac930f1f6 Mon Sep 17 00:00:00 2001 From: Ilyas Date: Mon, 7 Aug 2023 15:06:57 +0200 Subject: [PATCH] tests --- ...est_sale_commission_product_criteria_domain.py | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/sale_commission_product_criteria_domain/tests/test_sale_commission_product_criteria_domain.py b/sale_commission_product_criteria_domain/tests/test_sale_commission_product_criteria_domain.py index 43c2c6fbc..9e2c735fe 100644 --- a/sale_commission_product_criteria_domain/tests/test_sale_commission_product_criteria_domain.py +++ b/sale_commission_product_criteria_domain/tests/test_sale_commission_product_criteria_domain.py @@ -53,12 +53,18 @@ def test_commission_domain(self): demo_crr_item_1 = self.env.ref( "sale_commission_product_criteria_domain.demo_crr_item_1" ) - + demo_cig_spain = self.env.ref( + "sale_commission_product_criteria_domain.demo_cig_spain" + ) # group must have commission of CI demo_crr_item_1.group_id.commission_ids = False demo_crr_item_1.write({"sequence": 2}) self.assertTrue(demo_crr_item_1.group_id.commission_ids) + # count related agents + demo_cig_spain._compute_agents_count() + self.assertEqual(demo_cig_spain.agents_count, 2) + # if commission is not type of restricted then CI must have no group demo_crr_item_1.commission_id = self.env.ref( "sale_commission_product_criteria.demo_commission_rules" @@ -80,9 +86,6 @@ def test_commission_domain(self): self.assertFalse(cia_azure.agent_group_ids) # false, when commission is not product_restricted - demo_cig_spain = self.env.ref( - "sale_commission_product_criteria_domain.demo_cig_spain" - ) res_partner_tiny_sale_agent.write( { "allowed_commission_group_ids": [(6, 0, demo_cig_spain.ids)], @@ -105,10 +108,6 @@ def test_commission_domain(self): action = demo_cig_spain.action_open_related_agents() self.assertEqual(type(action), dict) - # count related agents - demo_cig_spain._compute_agents_count() - self.assertEqual(demo_cig_spain.agents_count, 2) - # you cant delete it having related CIs with self.assertRaises(exception=odoo.exceptions.ValidationError): demo_cig_spain.unlink()