From 686c3eff35aeb3dab9ce01245b4e3e1e12b6ea75 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Mon, 12 May 2025 00:10:33 +0200 Subject: [PATCH] Test on_change_notification_email of trigger --- modules/notification_email/tests/test_module.py | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/modules/notification_email/tests/test_module.py b/modules/notification_email/tests/test_module.py index 04d0448881..ac2284ed1d 100644 --- a/modules/notification_email/tests/test_module.py +++ b/modules/notification_email/tests/test_module.py @@ -94,14 +94,15 @@ class NotificationEmailTestCase(CompanyTestMixin, ModuleTestCase): model, = Model.search([ ('name', '=', User.__name__), ]) - trigger, = Trigger.create([{ - 'name': 'Test creation', - 'model': model.id, - 'on_create_': True, - 'condition': 'true', - 'notification_email': notification_email.id, - 'action': 'notification.email|trigger', - }]) + trigger = Trigger( + name="Test creation", + model=model, + on_create_=True, + condition='true', + notification_email=notification_email) + trigger.on_change_notification_email() + self.assertEqual(trigger.action, 'notification.email|trigger') + trigger.save() with patch.object( notification_module,