def test_upadte(self): label = dict(name='80后',category=1) val = m_exists(TName,**label) if val: print m_del(TName,val['_id']) print add(1,'80后') print add(1,'80后') print add(1,'80后') print add(1,'90后') print add(1,'90后') val = m_exists(TName,**label) print val assert val['usage'] ==3 print 'suggest:',suggest(1)
def test_update(self): label = dict(name='80后',category=1) val = m_exists(TName,**label) if val: print m_del(TName,val['_id']) print add(1,'80后') print add(1,'80后') print add(1,'80后') print add(1,'90后') print add(1,'90后') val = m_exists(TName,**label) print val assert val['usage'] ==3 print 'suggest:',suggest(1)
def post(self): _id = self.get_argument("id", None) r, v = m_del(TNews, _id) self.write(dict(status=r, data=v))
def tearDownClass(cls): if cls.entity_id: m_del('city',cls.entity_id,is_del=True)
def post(self): _id = self.get_argument("id", None) r,v = m_del(T_CATEGORY,_id) self.write(dict(status = r,data = v))
def get(self,table): r,v= m_del(table,self.get_argument('id')) self.write(dict(status = r, data = v))
def get(self, table): r, v = m_del(table, self.get_argument('id')) self.write(dict(status=r, data=v))
def post(self): _id = self.get_argument("id", None) r,v = m_del(T_Servercity,_id) self.write(dict(status = r,data = v))