From 5567ee432a30be416b58ca3d6330b2c61065212d Mon Sep 17 00:00:00 2001 From: Matthias Date: Sat, 4 Dec 2021 18:50:49 +0100 Subject: [PATCH] more coverage --- InvenTree/common/test_notifications.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/InvenTree/common/test_notifications.py b/InvenTree/common/test_notifications.py index 03b658f959..702720ffd1 100644 --- a/InvenTree/common/test_notifications.py +++ b/InvenTree/common/test_notifications.py @@ -36,6 +36,15 @@ class BaseNotificationTests(BaseNotificationIntegrationTest): def send(self): """a comment so we do not need a pass""" + class WrongDeliveryImplementation(SingleNotificationMethod): + METHOD_NAME = 'WrongDeliveryImplementation' + + def get_targets(self): + return [1, ] + + def send(self, target): + return False + # no send / send bulk with self.assertRaises(NotImplementedError): FalseNotificationMethod('', '', '', '', ) @@ -52,6 +61,9 @@ class BaseNotificationTests(BaseNotificationIntegrationTest): with self.assertRaises(NotImplementedError): AnotherFalseNotificationMethod('', '', '', {'name': 1, 'message': 2, }, ) + # cover faling delivery + self._notification_run() + def test_errors_passing(self): """ensure that errors do not kill the whole delivery"""