From 2d1026987dd492e00a1de67f2964340bcd517a00 Mon Sep 17 00:00:00 2001 From: Andhitia Rama Date: Mon, 12 Mar 2018 20:52:41 +0700 Subject: [PATCH] Revision on test_raise_error --- .../tests/test_mrp_production_request.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/mrp_production_request/tests/test_mrp_production_request.py b/mrp_production_request/tests/test_mrp_production_request.py index b9d95bda1..bff002f85 100644 --- a/mrp_production_request/tests/test_mrp_production_request.py +++ b/mrp_production_request/tests/test_mrp_production_request.py @@ -60,6 +60,7 @@ class TestMrpProductionRequest(TransactionCase): "product_uom": product.uom_id.id, "warehouse_id": self.env.ref("stock.warehouse0").id, "location_id": self.env.ref("stock.stock_location_stock").id, + "rule_id": self.mrp_rule.id, "route_ids": [ (4, self.env.ref("mrp.route_warehouse0_manufacture").id, 0)] } @@ -134,10 +135,12 @@ class TestMrpProductionRequest(TransactionCase): """Tests user errors raising properly.""" proc_no_bom = self.create_procurement_no_bom('TEST/05', self.test_product) - self.env["procurement.order"]._run(proc_no_bom) + # self.env["procurement.order"]._run(proc_no_bom) + proc_no_bom.run() self.assertEqual(proc_no_bom.state, 'exception') proc = self.create_procurement('TEST/05', self.product) + proc.run() request = proc.mrp_production_request_id request.button_to_approve() proc.write({'state': 'done'}) @@ -165,4 +168,4 @@ class TestMrpProductionRequest(TransactionCase): self.assertNotEqual(request.state, 'cancel') proc.cancel() self.assertEqual(proc.state, "TEST") - self.assertEqual(request.state, 'cancel') \ No newline at end of file + self.assertEqual(request.state, 'cancel')