changeset 8df83d0cea81 in modules/sale_gift_card:default
details: 
https://hg.tryton.org/modules/sale_gift_card?cmd=changeset&node=8df83d0cea81
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
diffstat:

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

diffs (16 lines):

diff -r 883c9d8af60c -r 8df83d0cea81 tests/scenario_sale_gift_card.rst
--- a/tests/scenario_sale_gift_card.rst Mon May 10 20:37:00 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