

def create_notification(self, **kwargs):
    notif_data = {
        'topic': 'discover',
        'message': 'Test message',
        'status': 'unread',
        'datetime': datetime.now(),
    }
    if kwargs:
        notif_data.update(kwargs)
    notification = Notification()
    notification.cluster_id = notif_data.get('cluster_id')
    for (f, v) in six.iteritems(notif_data):
        setattr(notification, f, v)
    self.db.add(notification)
    self.db.commit()
    return notification

dataset/ETHPy150Open openstack/fuel-web/nailgun/nailgun/test/base.py EnvironmentManager.create_notification/original