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
This commit is contained in:
Cédric Krier committed 2021-05-15 09:22:28 +02:00
1 parent 509907b655
commit 998079e79c
1 file changed
+3 -2
+3 -2
View File
@@ -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::