summaryrefslogtreecommitdiff
path: root/addons/purchase_mrp
diff options
context:
space:
mode:
Diffstat (limited to 'addons/purchase_mrp')
-rw-r--r--addons/purchase_mrp/tests/test_purchase_mrp_flow.py38
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)