From 998079e79cd3d41c67064da99d21cb189854a3cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Sat, 15 May 2021 09:22:28 +0200 Subject: [PATCH] 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 25729b538f2df592e6a370aa0c75a6b2ac1a1684) --HG-- branch : 6.0 --- tests/scenario_marketing_automation.rst | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/scenario_marketing_automation.rst b/tests/scenario_marketing_automation.rst index b529a37d94..1f005b3848 100644 --- a/tests/scenario_marketing_automation.rst +++ b/tests/scenario_marketing_automation.rst @@ -13,9 +13,10 @@ Imports:: Patch sendmail_transactional:: - >>> from unittest.mock import MagicMock + >>> from unittest.mock import patch >>> from trytond.modules.marketing_automation import marketing_automation - >>> marketing_automation.sendmail_transactional = smtp_calls = MagicMock() + >>> smtp_calls = patch.object( + ... marketing_automation, 'sendmail_transactional').start() Activate modules::