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
2184400a73
commit
49f903989f
1 file changed
+3
-2
@@ -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::
|
||||
|
||||
|
||||
Reference in new issue
Block a user