changeset 49b850e404ec in modules/web_shop_vue_storefront:6.0
details:
https://hg.tryton.org/modules/web_shop_vue_storefront?cmd=changeset&node=49b850e404ec
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 2b749711d629c35c1d2025fddb053ddb3bfa5edd)
diffstat:
tests/scenario_web_shop_vue_storefront.rst | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diffs (22 lines):
diff -r 58ebdc5a7f66 -r 49b850e404ec tests/scenario_web_shop_vue_storefront.rst
--- a/tests/scenario_web_shop_vue_storefront.rst Mon May 03 16:08:49
2021 +0200
+++ b/tests/scenario_web_shop_vue_storefront.rst Sat May 15 09:22:28
2021 +0200
@@ -5,7 +5,7 @@
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 @@
>>> 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::