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) --HG-- branch : 6.0
This commit is contained in:
1 parent
a5d7da2c82
commit
3a660be2ec
1 file changed
+3
-2
@@ -15,9 +15,10 @@ Imports::
|
||||
|
||||
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::
|
||||
|
||||
|
||||
Reference in new issue
Block a user