def test_query_recent(self): a = MEntity.get_by_uid(self.uid) assert a == None self.add_message() a = MEntity.get_by_uid(self.uid) assert a self.tearDown()
def test_delete(self): tf = MEntity.get_by_uid(self.uid) assert tf == None self.add_message() tf = MEntity.delete(self.uid) assert tf tf = MEntity.get_by_uid(self.uid) assert tf == None self.tearDown()
def add_url(self, post_data): ''' Adding the URL as entity. ''' img_desc = post_data['desc'] img_path = post_data['file1'] cur_uid = tools.get_uudd(4) while MEntity.get_by_uid(cur_uid): cur_uid = tools.get_uudd(4) MEntity.create_entity(cur_uid, img_path, img_desc, kind=3) kwd = { 'kind': '3', } self.render('misc/entity/entity_view.html', filename=img_path, cfg=config.CMS_CFG, kwd=kwd, userinfo=self.userinfo)
def test_get_by_uid(self): MEntity.get_by_uid(self.uid) assert True
def tearDown(self): print("function teardown") tt = MEntity.get_by_uid(self.uid) if tt: MEntity.delete(tt.uid)
def test_query_recent(self): MEntity.get_by_uid(self.uid) assert True