more debug prints

This commit is contained in:
Matthias 2021-12-04 00:43:46 +01:00
parent 6e464447f5
commit 33b7d9b845
No known key found for this signature in database
GPG Key ID: F50EF5741D33E076
2 changed files with 6 additions and 1 deletions

View File

@ -118,8 +118,9 @@ def trigger_notifaction(obj, entry_name=None, obj_ref='pk', receivers=None, rece
# Collect possible methods # Collect possible methods
delivery_methods = inheritors(NotificationMethod) delivery_methods = inheritors(NotificationMethod)
# TODO remove -> this is for debugging the delivery method runfs
if settings.TESTING: if settings.TESTING:
print('TESTING')
print(delivery_methods) print(delivery_methods)
for method in [a for a in delivery_methods if a not in [SingleNotificationMethod, BulkNotificationMethod]]: 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: try:
deliver_notification(method, obj, entry_name, receivers, notification_context) deliver_notification(method, obj, entry_name, receivers, notification_context)
except NotImplementedError as error: except NotImplementedError as error:
print('NotImplementedError')
raise error raise error
except Exception as error: except Exception as error:
print(error)
logger.error(error) logger.error(error)
# Set delivery flag # Set delivery flag

View File

@ -25,6 +25,7 @@ class NotificationTests(BaseNotificationIntegrationTest):
def test_SingleNotificationMethod(self): def test_SingleNotificationMethod(self):
"""ensure the implementation requirements are tested""" """ensure the implementation requirements are tested"""
print('TESTING SingleNotificationMethod')
class WrongImplementation(SingleNotificationMethod): class WrongImplementation(SingleNotificationMethod):
def setup(self): def setup(self):
@ -36,6 +37,7 @@ class NotificationTests(BaseNotificationIntegrationTest):
def test_BulkNotificationMethod(self): def test_BulkNotificationMethod(self):
"""ensure the implementation requirements are tested""" """ensure the implementation requirements are tested"""
print('TESTING BulkNotificationMethod')
class WrongImplementation(BulkNotificationMethod): class WrongImplementation(BulkNotificationMethod):
def setup(self): def setup(self):