Ensure context is set when testing lot quantity

Since changeset 3a17f8e704a7, there is no more context leak so the context when
computing quantities is exactly the one at the instantiation.

review25231002
This commit is contained in:
Sergi Almacellas Abellana
2016-06-15 11:16:13 +02:00
parent 2081bf7645
commit ab17e27abb
+1
View File
@@ -112,6 +112,7 @@ class StockLotTestCase(ModuleTestCase):
(storage.id, product.id, None): 3,
})
with Transaction().set_context(locations=[storage.id]):
lot1, lot2 = Lot.browse([lot1, lot2])
self.assertEqual(lot1.quantity, 5)
self.assertEqual(lot2.quantity, 8)