示例#1
0
 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()
示例#2
0
    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()
示例#3
0
 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)
示例#4
0
 def test_get_by_uid(self):
     MEntity.get_by_uid(self.uid)
     assert True
示例#5
0
 def tearDown(self):
     print("function teardown")
     tt = MEntity.get_by_uid(self.uid)
     if tt:
         MEntity.delete(tt.uid)
示例#6
0
 def test_query_recent(self):
     MEntity.get_by_uid(self.uid)
     assert True