This commit is contained in:
jbeficent
2016-11-07 15:44:55 +01:00
committed by Jordi Ballester Alomar
parent fe769edaa0
commit e2ba0eebe4

View File

@@ -53,12 +53,12 @@ class TestStockWarehouseOrderpoint(common.TransactionCase):
def create_orderpoint(self):
"""Create a Reordering rule for the product."""
record = self.reordering_rule_model.create({
'name': 'Reordering Rule',
'product_id': self.product.id,
'product_min_qty': '1',
'product_max_qty': '5',
'qty_multiple': '1',
'location_id': self.dest_location.id,
'name': 'Reordering Rule',
'product_id': self.product.id,
'product_min_qty': '1',
'product_max_qty': '5',
'qty_multiple': '1',
'location_id': self.dest_location.id,
})
return record
@@ -77,21 +77,21 @@ class TestStockWarehouseOrderpoint(common.TransactionCase):
return move
def test_product_qty(self):
'Tests the product quantity in the Reordering rules'
"""Tests the product quantity in the Reordering rules"""
# Checks the product availability
self.reordering_record._product_available()
self.reordering_record.refresh()
self.assertFalse(self.reordering_record.available)
# Create & process moves to test the product quantity
self.move = self.create_stock_move()
self.reordering_record._product_available_qty()
move = self.create_stock_move()
self.reordering_record.refresh()
self.assertEqual(self.reordering_record.incoming_location_qty,
self.product.incoming_qty,
'Incoming Qty does not match')
self.assertEqual(self.reordering_record.virtual_location_qty,
self.product.virtual_available,
'Virtual Qty does not match')
self.move.action_done()
self.reordering_record._product_available_qty()
move.action_done()
self.reordering_record.refresh()
self.assertEqual(self.reordering_record.product_location_qty,
self.product.qty_available,
'Available Qty does not match')
@@ -99,5 +99,5 @@ class TestStockWarehouseOrderpoint(common.TransactionCase):
self.product.virtual_available,
'Virtual Qty does not match')
# Checks the product availability after moves processed
self.reordering_record._product_available()
self.reordering_record.refresh()
self.assertTrue(self.reordering_record.available)