From 69383a1b7e7eab016008f0b6358c1c5402c1e7c3 Mon Sep 17 00:00:00 2001 From: "Pedro M. Baeza" Date: Thu, 20 Feb 2020 08:34:14 +0100 Subject: [PATCH] [IMP] stock_mts_mto_rule: Make tests resilient Using an already created product can lead to incorrect tests on integrated environments where other modules modify this product. We create a new one for avoiding this side effect. --- stock_mts_mto_rule/tests/test_mto_mts_route.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/stock_mts_mto_rule/tests/test_mto_mts_route.py b/stock_mts_mto_rule/tests/test_mto_mts_route.py index 6f07eb7d9..f40e2433d 100644 --- a/stock_mts_mto_rule/tests/test_mto_mts_route.py +++ b/stock_mts_mto_rule/tests/test_mto_mts_route.py @@ -149,7 +149,10 @@ class TestMtoMtsRoute(TransactionCase): self.uom = self.env['uom.uom'].browse(1) self.warehouse.mto_mts_management = True self.customer_loc = self.env.ref('stock.stock_location_customers') - self.product = self.env.ref('product.product_product_4') + self.product = self.env['product.product'].create({ + 'name': 'Test product', + 'type': 'product', + }) self.company_partner = self.env.ref('base.main_partner') self.group = self.env['procurement.group'].create({ 'name': 'test',