From 59cf521ff43e85013f0a480d65cc0e2ee8a4c0a8 Mon Sep 17 00:00:00 2001 From: Lanto Razafindrabe Date: Mon, 29 Apr 2024 14:58:30 +0300 Subject: [PATCH] TA#65108 [IMP] Code quality --- .unported/mrp_cost/tests/test_mrp.py | 32 ++++++++++++++++++---------- 1 file changed, 21 insertions(+), 11 deletions(-) diff --git a/.unported/mrp_cost/tests/test_mrp.py b/.unported/mrp_cost/tests/test_mrp.py index 54c67c7..486f653 100644 --- a/.unported/mrp_cost/tests/test_mrp.py +++ b/.unported/mrp_cost/tests/test_mrp.py @@ -35,9 +35,10 @@ def setUpClass(cls): cls.workcenter_cost = 100 cls.workcenter = cls.env["mrp.workcenter"].create( { - "name": "My Work Center", - "costs_hour": cls.workcenter_cost, - }) + "name": "My Work Center", + "costs_hour": cls.workcenter_cost, + } + ) cls.bom = cls.env["mrp.bom"].create( { @@ -46,8 +47,9 @@ def setUpClass(cls): "bom_line_ids": [ (0, 0, cls._get_bom_line_vals(cls.product_b, 1)), (0, 0, cls._get_bom_line_vals(cls.product_c, 2)), - ] - }) + ], + } + ) cls.order = cls.env["mrp.production"].create( { @@ -96,12 +98,20 @@ def test_workcenter_cost(self): assert move.value == 200 # 2 hours * 100 def _run_production(self): - wizard = self.env['mrp.product.produce'].with_context({ - 'active_id': self.order.id, - 'active_ids': [self.order.id], - }).create({ - 'product_qty': 1.0, - }) + wizard = ( + self.env["mrp.product.produce"] + .with_context( + { + "active_id": self.order.id, + "active_ids": [self.order.id], + } + ) + .create( + { + "product_qty": 1.0, + } + ) + ) wizard._onchange_product_qty() wizard.do_produce() self.order.post_inventory()