From 33b7d9b845b14c5fc38f8b0fd20d0dbb62fd3a6a Mon Sep 17 00:00:00 2001 From: Matthias Date: Sat, 4 Dec 2021 00:43:46 +0100 Subject: [PATCH] more debug prints --- InvenTree/common/notifications.py | 5 ++++- InvenTree/common/test_notifications.py | 2 ++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/InvenTree/common/notifications.py b/InvenTree/common/notifications.py index ec24df0bf2..0d61e3d0c7 100644 --- a/InvenTree/common/notifications.py +++ b/InvenTree/common/notifications.py @@ -118,8 +118,9 @@ def trigger_notifaction(obj, entry_name=None, obj_ref='pk', receivers=None, rece # Collect possible methods delivery_methods = inheritors(NotificationMethod) + + # TODO remove -> this is for debugging the delivery method runfs if settings.TESTING: - print('TESTING') print(delivery_methods) for method in [a for a in delivery_methods if a not in [SingleNotificationMethod, BulkNotificationMethod]]: @@ -127,8 +128,10 @@ def trigger_notifaction(obj, entry_name=None, obj_ref='pk', receivers=None, rece try: deliver_notification(method, obj, entry_name, receivers, notification_context) except NotImplementedError as error: + print('NotImplementedError') raise error except Exception as error: + print(error) logger.error(error) # Set delivery flag diff --git a/InvenTree/common/test_notifications.py b/InvenTree/common/test_notifications.py index 4785de8908..8eff1ef7fc 100644 --- a/InvenTree/common/test_notifications.py +++ b/InvenTree/common/test_notifications.py @@ -25,6 +25,7 @@ class NotificationTests(BaseNotificationIntegrationTest): def test_SingleNotificationMethod(self): """ensure the implementation requirements are tested""" + print('TESTING SingleNotificationMethod') class WrongImplementation(SingleNotificationMethod): def setup(self): @@ -36,6 +37,7 @@ class NotificationTests(BaseNotificationIntegrationTest): def test_BulkNotificationMethod(self): """ensure the implementation requirements are tested""" + print('TESTING BulkNotificationMethod') class WrongImplementation(BulkNotificationMethod): def setup(self):