def reg_user_by_form(): ''' @todo:注册用户 ''' res = reg_user(form2dic(request.form)) if res: session.update(set_user_session({}, res)) return redirect('/') else: return render_template('info.html', info=u"服务器错误")
def test_reg_user(self): reg_user({'_id':'test'}) self.assertTrue(bool(db.users.find_one({'_id':'test'})))