changeset a8bb6b84772d in modules/stock_shipment_cost:6.0
details: 
https://hg.tryton.org/modules/stock_shipment_cost?cmd=changeset&node=a8bb6b84772d
description:
        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
        (grafted from df2d180aecaf85de88f8501f2f703ffc9dc4564b)
diffstat:

 tests/scenario_stock_shipment_cost.rst |  6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diffs (17 lines):

diff -r 1306c1b61636 -r a8bb6b84772d tests/scenario_stock_shipment_cost.rst
--- a/tests/scenario_stock_shipment_cost.rst    Mon May 03 15:46:17 2021 +0200
+++ b/tests/scenario_stock_shipment_cost.rst    Sat May 15 09:22:28 2021 +0200
@@ -15,9 +15,11 @@
 
 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::
 

Reply via email to