From 5581a9048a04be094506b9b2d2e23fa4fa9e67d6 Mon Sep 17 00:00:00 2001 From: "Pedro M. Baeza" Date: Fri, 16 Nov 2018 18:25:59 +0100 Subject: [PATCH] [IMP] contract: Make price test more deterministic As this uses demo data, it may returns an invalid price. --- contract/tests/test_contract.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/contract/tests/test_contract.py b/contract/tests/test_contract.py index 6e59973a..2ab19a91 100644 --- a/contract/tests/test_contract.py +++ b/contract/tests/test_contract.py @@ -27,10 +27,11 @@ class TestContractBase(common.SavepointCase): ) # For being sure of the applied price cls.env['product.pricelist.item'].create({ + 'applied_on': '0_product_variant', 'pricelist_id': cls.partner.property_product_pricelist.id, 'product_id': cls.product.id, - 'compute_price': 'formula', - 'base': 'list_price', + 'compute_price': 'fixed', + 'fixed_price': 1100, }) cls.contract = cls.env['account.analytic.account'].create({ 'name': 'Test Contract', @@ -69,7 +70,6 @@ class TestContract(TestContractBase): def test_automatic_price(self): self.acct_line.automatic_price = True - self.product.list_price = 1100 self.assertEqual(self.acct_line.price_unit, 1100) # Try to write other price self.acct_line.price_unit = 10