mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
test that single errors do not kill the whole
This commit is contained in:
parent
cfd509adb4
commit
13b390d69b
@ -52,6 +52,19 @@ class NotificationTests(BaseNotificationIntegrationTest):
|
|||||||
with self.assertRaises(NotImplementedError):
|
with self.assertRaises(NotImplementedError):
|
||||||
AnotherFalseNotificationMethod('', '', '', {'name': 1, 'message': 2, }, )
|
AnotherFalseNotificationMethod('', '', '', {'name': 1, 'message': 2, }, )
|
||||||
|
|
||||||
|
def test_errors_passing(self):
|
||||||
|
"""ensure that errors do not kill the whole delivery"""
|
||||||
|
|
||||||
|
class ErrorImplementation(SingleNotificationMethod):
|
||||||
|
METHOD_NAME = 'ErrorImplementation'
|
||||||
|
|
||||||
|
def get_targets(self):
|
||||||
|
return [1, ]
|
||||||
|
|
||||||
|
def send(self, target):
|
||||||
|
raise KeyError('This could be any error')
|
||||||
|
|
||||||
|
self._notification_run()
|
||||||
|
|
||||||
|
|
||||||
def test_SingleNotificationMethod(self):
|
def test_SingleNotificationMethod(self):
|
||||||
|
Loading…
Reference in New Issue
Block a user