from notifications.models_interface import Repository
from notifications.notificationevent import NotificationEvent
from test.fixtures import *
def test_all_notifications(initialized_db):
for subc in NotificationEvent.__subclasses__():
if subc.event_name() is not None:
# Create the notification event.
found = NotificationEvent.get_event(subc.event_name())
sample_data = found.get_sample_data(Repository('foo', 'bar'), {'level': 'low'})
# Make sure all calls succeed.
notification_data = {
'performer_data': {},
}
found.get_level(sample_data, notification_data)
found.get_summary(sample_data, notification_data)
found.get_message(sample_data, notification_data)