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 2b749711d629c35c1d2025fddb053ddb3bfa5edd)

--HG--
branch : 6.0
This commit is contained in:
Cédric Krier committed 2021-05-15 09:22:28 +02:00
1 parent 92a420fe67
commit 1bf0748b51
1 file changed
+3 -2
+3 -2
View File
@@ -5,7 +5,7 @@ Web Shop Vue Storefront Scenario
Imports::
>>> from decimal import Decimal
>>> from unittest.mock import MagicMock, ANY
>>> from unittest.mock import MagicMock, ANY, patch
>>> from proteus import Model
>>> from trytond.tests.tools import activate_modules
@@ -21,7 +21,8 @@ Patch elasticsearch::
>>> from trytond.modules.web_shop_vue_storefront import web
>>> es = MagicMock()
>>> web.VSFElasticsearch = MagicMock(return_value=es)
>>> _ = patch.object(
... web, 'VSFElasticsearch', return_value=es).start()
Install web_shop_vue_storefront::