Esempio n. 1
0
def create_info_action():
    _id = session.get('_id', None)
    if _id: 
        if request.form:     
            create_info(request.form['collection'], form2dic(request.form), _id)
            return redirect(request.form['return'])
        else:
            return redirect('/')
    else:
        return redirect('/')
Esempio n. 2
0
 def test_create_info(self):
     create_info('info_test', self.create_info_data, 'test')
     self.assertTrue(bool(db.info_test.find_one({'test':'test'})))