Exemplo n.º 1
0
    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)
Exemplo n.º 2
0
    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)
Exemplo n.º 3
0
 def post(self):
    name = self.get_argument('name',None)
    category = int(self.get_argument('category','0'))
    r,v = add(category, name)
    self.write(dict(status=r, data=v))
Exemplo n.º 4
0
 def post(self):
     name = self.get_argument('name', None)
     category = int(self.get_argument('category', '0'))
     r, v = add(category, name)
     self.write(dict(status=r, data=v))