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
This commit is contained in:
1 parent
860318236a
commit
e9b9495f60
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