Use start and stop methods of patch in scenario
This ensure that the modification on the object are removed at the end of the scenario. issue10422 review332891002
This commit is contained in:
1 parent
85711fc313
commit
1ed3ec7699
1 file changed
+4
-2
@@ -15,9 +15,11 @@ Imports::
|
||||
|
||||
Patch _get_shipment_cost::
|
||||
|
||||
>>> from unittest.mock import Mock
|
||||
>>> from unittest.mock import patch
|
||||
>>> from trytond.modules.stock_shipment_cost.stock import ShipmentCostMixin
|
||||
>>> ShipmentCostMixin._get_shipment_cost = Mock(return_value=Decimal('5'))
|
||||
>>> mock = patch.object(
|
||||
... ShipmentCostMixin, '_get_shipment_cost',
|
||||
... return_value=Decimal('5')).start()
|
||||
|
||||
Activate modules::
|
||||
|
||||
|
||||
Reference in new issue
Block a user