changeset 2a15c7025176 in modules/sale_gift_card:6.0
details: 
https://hg.tryton.org/modules/sale_gift_card?cmd=changeset&node=2a15c7025176
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 8df83d0cea818e030e694a61ca38e217ecaf60bc)
diffstat:

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

diffs (16 lines):

diff -r 2740293a7926 -r 2a15c7025176 tests/scenario_sale_gift_card.rst
--- a/tests/scenario_sale_gift_card.rst Mon May 10 21:22:49 2021 +0200
+++ b/tests/scenario_sale_gift_card.rst Sat May 15 09:22:28 2021 +0200
@@ -15,9 +15,10 @@
 
 Patch sendmail_transactional::
 
-    >>> from unittest.mock import MagicMock
+    >>> from unittest.mock import patch
     >>> from trytond.modules.sale_gift_card import sale
-    >>> sale.sendmail_transactional = smtp_calls = MagicMock()
+    >>> smtp_calls = patch.object(
+    ...     sale, 'sendmail_transactional').start()
 
 Activate modules::
 

Reply via email to