def test__silent_when_no_node(self): event_type = factory.make_EventType() description = factory.make_name('description') # Exception should not be raised. events.send_event( factory.make_name('system_id'), event_type.name, description, datetime.datetime.utcnow())
def test__creates_event_for_node(self): event_type = factory.make_EventType() node = factory.make_Node() description = factory.make_name('description') timestamp = datetime.datetime.utcnow() events.send_event(node.system_id, event_type.name, description, timestamp) # Doesn't raise a DoesNotExist error. Event.objects.get(node=node, type=event_type, description=description, created=timestamp)