diff options
| author | Julien Castiaux <juc@odoo.com> | 2019-09-11 09:45:31 +0000 |
|---|---|---|
| committer | Julien Castiaux <juc@odoo.com> | 2019-09-17 11:36:42 +0000 |
| commit | 4f03a5f136ab928ae74322bf1c34a1b6a6baf979 (patch) | |
| tree | e0e0c0653888751c165b9ffb269d3b70853badef /addons/purchase_mrp | |
| parent | 6c948c36bbf72dd896e0bff03aa7fbddadcbb0cd (diff) | |
[FIX] *: remove old deprecated modules/functions
PEP-594 is deprecating a bunch of modules. As part of the cleanup, we
are also dealing with long deprecated modules, functions and aliases.
* `assert_` -> `assertTrue`
* `assertEquals` -> `assertEqual`
* `assertNotEquals` -> `assertNotEqual`
* `assertAlmostEquals` -> `assertAlmostEqual`
* `assertRaisesRegexp` -> `assertRaisesRegex`
* `assertRegexpMatches` -> `assertRegex`
* `base64.encodestring` -> `base64.encodebytes`
* `base64.decodestring` -> `base64.decodebytes`
* `inspect.getargspec` -> `inspect.signature`
* `inspect.formatargspec` -> `inspect.signature`
* `logging.warn` -> `logging.warning`
closes odoo/odoo#36863
Task: 2003936
Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
Diffstat (limited to 'addons/purchase_mrp')
| -rw-r--r-- | addons/purchase_mrp/tests/test_purchase_mrp_flow.py | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/addons/purchase_mrp/tests/test_purchase_mrp_flow.py b/addons/purchase_mrp/tests/test_purchase_mrp_flow.py index ea99478a93b..03f17161fe8 100644 --- a/addons/purchase_mrp/tests/test_purchase_mrp_flow.py +++ b/addons/purchase_mrp/tests/test_purchase_mrp_flow.py @@ -177,7 +177,7 @@ class TestSaleMrpFlow(TransactionCase): """ moves_to_process = moves.filtered(lambda m: m.product_id in quantities_to_process.keys()) for move in moves_to_process: - self.assertEquals(move.product_uom_qty, quantities_to_process[move.product_id]) + self.assertEqual(move.product_uom_qty, quantities_to_process[move.product_id]) def _create_move_quantities(self, qty_to_process, components, warehouse): """ Helper to creates moves in order to update the quantities of components @@ -237,7 +237,7 @@ class TestSaleMrpFlow(TransactionCase): # Check picking creation, its move lines should concern # only components. Also checks that the quantities are corresponding # to the PO - self.assertEquals(len(po.picking_ids), 1) + self.assertEqual(len(po.picking_ids), 1) order_line = po.order_line[0] picking_original = po.picking_ids[0] move_lines = picking_original.move_lines @@ -255,7 +255,7 @@ class TestSaleMrpFlow(TransactionCase): self.component_g: 28.0 } - self.assertEquals(len(move_lines), 7) + self.assertEqual(len(move_lines), 7) self.assertTrue(not any(kit in products for kit in kits)) self.assertTrue(all(component in products for component in components)) self._assert_quantities(move_lines, expected_quantities) @@ -269,13 +269,13 @@ class TestSaleMrpFlow(TransactionCase): backorder_wizard.process() # Check that a backorded is created - self.assertEquals(len(po.picking_ids), 2) + self.assertEqual(len(po.picking_ids), 2) backorder_1 = po.picking_ids - picking_original - self.assertEquals(backorder_1.backorder_id.id, picking_original.id) + self.assertEqual(backorder_1.backorder_id.id, picking_original.id) # Even if some components are received completely, # no KitParent should be received - self.assertEquals(order_line.qty_received, 0) + self.assertEqual(order_line.qty_received, 0) # Process just enough components to make 1 kit_parent qty_to_process = { @@ -289,12 +289,12 @@ class TestSaleMrpFlow(TransactionCase): backorder_wizard.process() # Only 1 kit_parent should be received at this point - self.assertEquals(order_line.qty_received, 1) + self.assertEqual(order_line.qty_received, 1) # Check that the second backorder is created - self.assertEquals(len(po.picking_ids), 3) + self.assertEqual(len(po.picking_ids), 3) backorder_2 = po.picking_ids - picking_original - backorder_1 - self.assertEquals(backorder_2.backorder_id.id, backorder_1.id) + self.assertEqual(backorder_2.backorder_id.id, backorder_1.id) # Set the components quantities that backorder_2 should have expected_quantities = { @@ -309,7 +309,7 @@ class TestSaleMrpFlow(TransactionCase): # Check that the computed quantities are matching the theorical ones. # Since component_e was totally processed, this componenent shouldn't be # present in backorder_2 - self.assertEquals(len(backorder_2.move_lines), 6) + self.assertEqual(len(backorder_2.move_lines), 6) move_comp_e = backorder_2.move_lines.filtered(lambda m: m.product_id.id == self.component_e.id) self.assertFalse(move_comp_e) self._assert_quantities(backorder_2.move_lines, expected_quantities) @@ -328,12 +328,12 @@ class TestSaleMrpFlow(TransactionCase): backorder_wizard.process() # Check that x3 kit_parents are indeed received - self.assertEquals(order_line.qty_received, 3) + self.assertEqual(order_line.qty_received, 3) # Check that the third backorder is created - self.assertEquals(len(po.picking_ids), 4) + self.assertEqual(len(po.picking_ids), 4) backorder_3 = po.picking_ids - (picking_original + backorder_1 + backorder_2) - self.assertEquals(backorder_3.backorder_id.id, backorder_2.id) + self.assertEqual(backorder_3.backorder_id.id, backorder_2.id) # Check the components quantities that backorder_3 should have expected_quantities = { @@ -352,7 +352,7 @@ class TestSaleMrpFlow(TransactionCase): # Validating the last backorder now it's complete. # All kits should be received backorder_3.button_validate() - self.assertEquals(order_line.qty_received, 7.0) + self.assertEqual(order_line.qty_received, 7.0) # Return all components processed by backorder_3 stock_return_picking_form = Form(self.env['stock.return.picking'] @@ -373,7 +373,7 @@ class TestSaleMrpFlow(TransactionCase): wiz.process() # Now quantity received should be 3 again - self.assertEquals(order_line.qty_received, 3) + self.assertEqual(order_line.qty_received, 3) stock_return_picking_form = Form(self.env['stock.return.picking'] .with_context(active_ids=return_pick.ids, active_id=return_pick.ids[0], @@ -395,14 +395,14 @@ class TestSaleMrpFlow(TransactionCase): backorder_wizard.process() # As one of each component is missing, only 6 kit_parents should be received - self.assertEquals(order_line.qty_received, 6) + self.assertEqual(order_line.qty_received, 6) # Check that the 4th backorder is created. - self.assertEquals(len(po.picking_ids), 7) + self.assertEqual(len(po.picking_ids), 7) backorder_4 = po.picking_ids - ( picking_original + backorder_1 + backorder_2 + backorder_3 + return_of_return_pick + return_pick) - self.assertEquals(backorder_4.backorder_id.id, return_of_return_pick.id) + self.assertEqual(backorder_4.backorder_id.id, return_of_return_pick.id) # Check the components quantities that backorder_4 should have for move in backorder_4.move_lines: - self.assertEquals(move.product_qty, 1) + self.assertEqual(move.product_qty, 1) |
