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:
Cédric Krier committed 2021-05-15 09:22:28 +02:00
1 parent 860318236a
commit e9b9495f60
1 file changed
+3 -2
+3 -2
View File
@@ -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::