From e86268222b642d4d5b46c461ca4fb90d044805da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Tue, 31 Aug 2021 14:40:47 +0000 Subject: [PATCH] [FIX] sms: fix mock when sending sms Only SMS not in error should be considered as sent instead of being unlinked. This has no effect on current tests but will be used in future cleaning. Task-2634957 Prepares Task-2535005 (SMS view pimp) and Task-2560666 (IAP feedback) PR odoo/odoo#75798 --- addons/sms/tests/common.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/sms/tests/common.py b/addons/sms/tests/common.py index b454796e81c..9ad3c3c3efc 100644 --- a/addons/sms/tests/common.py +++ b/addons/sms/tests/common.py @@ -65,7 +65,7 @@ class MockSMS(common.BaseCase): return sms_unlink_origin(records, *args, **kwargs) # hack: instead of unlink, update state to sent for tests else: - records.filtered(lambda sms: sms.id in self._new_sms.ids).state = 'sent' + records.filtered(lambda sms: sms.id in self._new_sms.ids and sms.state != 'error').state = 'sent' return True try: