changeset 2428c9bd9c90 in modules/marketing_automation:5.8
details: 
https://hg.tryton.org/modules/marketing_automation?cmd=changeset&node=2428c9bd9c90
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 25729b538f2df592e6a370aa0c75a6b2ac1a1684)
diffstat:

 tests/scenario_marketing_automation.rst |  5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diffs (16 lines):

diff -r cd21634694ea -r 2428c9bd9c90 tests/scenario_marketing_automation.rst
--- a/tests/scenario_marketing_automation.rst   Wed Mar 03 18:30:40 2021 +0100
+++ b/tests/scenario_marketing_automation.rst   Sat May 15 09:22:28 2021 +0200
@@ -13,9 +13,10 @@
 
 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::
 

Reply via email to