From 72ba1fa9d68f406a9e1793acf0a95d6ed22bffec Mon Sep 17 00:00:00 2001 From: "Pedro M. Baeza" Date: Sat, 29 Sep 2018 12:22:29 +0200 Subject: [PATCH] [IMP] contract: Don't depend on external data The test as it was, leaves to the demo pricelist the control on the price of the product, so other modules that modifies this pricelist will make the test to fail. This is the minimum change needed for avoiding the problem. --- contract/tests/test_contract.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/contract/tests/test_contract.py b/contract/tests/test_contract.py index cc676bbbf..d0e48e4a3 100644 --- a/contract/tests/test_contract.py +++ b/contract/tests/test_contract.py @@ -24,6 +24,13 @@ class TestContractBase(common.SavepointCase): cls.template = cls.env['account.analytic.contract'].create( cls.template_vals, ) + # For being sure of the applied price + cls.env['product.pricelist.item'].create({ + 'pricelist_id': cls.partner.property_product_pricelist.id, + 'product_id': cls.product.id, + 'compute_price': 'formula', + 'base': 'list_price', + }) cls.contract = cls.env['account.analytic.account'].create({ 'name': 'Test Contract', 'partner_id': cls.partner.id,