Link to transport
This commit is contained in:
@@ -219,8 +219,8 @@ class PurchaseTradeTestCase(ModuleTestCase):
|
||||
'planned_to_location': 20,
|
||||
})
|
||||
|
||||
def test_lot_shipping_create_shipment_uses_planned_locations(self):
|
||||
'link to transport creates shipment in from planned locations'
|
||||
def test_lot_shipping_create_shipment_links_planned_locations(self):
|
||||
'link to transport creates shipment in and links planned locations'
|
||||
wizard = lot_module.LotShipping()
|
||||
supplier = Mock(id=30)
|
||||
created_shipment = Mock(id=40)
|
||||
@@ -236,15 +236,19 @@ class PurchaseTradeTestCase(ModuleTestCase):
|
||||
|
||||
with patch('trytond.modules.purchase_trade.lot.Pool') as PoolMock:
|
||||
PoolMock.return_value.get.return_value = ShipmentIn
|
||||
state = wizard.transition_create_shipment()
|
||||
with patch.object(
|
||||
wizard, 'transition_shipping', return_value='end'
|
||||
) as transition_shipping:
|
||||
state = wizard.transition_create_shipment()
|
||||
|
||||
self.assertEqual(state, 'ship')
|
||||
self.assertEqual(state, 'end')
|
||||
ShipmentIn.create.assert_called_once_with([{
|
||||
'supplier': 30,
|
||||
'from_location': 10,
|
||||
'to_location': 20,
|
||||
}])
|
||||
self.assertEqual(wizard.default_ship(None)['shipment_in'], 40)
|
||||
self.assertEqual(wizard.ship.shipment_in, created_shipment)
|
||||
transition_shipping.assert_called_once_with()
|
||||
|
||||
@with_transaction()
|
||||
def test_get_mtm_applies_component_ratio_as_percentage(self):
|
||||
|
||||
Reference in New Issue
Block a user