def test_add(self): ps= self.get_citys() for p in ps: if p['id']<100: print p['name'],p['id'] r,v=add(p['name']) cs = self.get_citys(p['id']) for c in cs: print '**',c['name'] rr,vv = add(c['name'],v['_id'],1) xs = self.get_citys(c['id']) for x in xs: print '****',x['name'] rrr,vvv = add(x['name'],vv['_id'],2)
def test_add(self): ps = self.get_citys() for p in ps: if p['id'] < 100: print p['name'], p['id'] r, v = add(p['name']) cs = self.get_citys(p['id']) for c in cs: print '**', c['name'] rr, vv = add(c['name'], v['_id'], 1) xs = self.get_citys(c['id']) for x in xs: print '****', x['name'] rrr, vvv = add(x['name'], vv['_id'], 2)
def test_add_failure2(self): ret,entity = add(None) self.assertFalse(ret,msg='the city name should not be none')
def test_add_failure1(self): ret,entity = add(name=self.city_name,parent=self.parent_name) self.assertFalse(ret,msg='the city has already exist')
def test_add_accuracy1(self): ret, entity = add(name=self.city_name,parent=self.parent_name) self.assertTrue(ret, msg='the add city must be successful') self.assertIsNotNone(entity,msg='the city entity should not be null') self.__class__.entity_id = entity['_id']