예제 #1
0
    def test_gist_comment(self):
        gist = self._add_gist()
        user_id = 'testuser'
        content = 'xxoo'
        new_content = 'ooxx'

        gc = GistComment.add(gist.id, user_id, content)
        assert isinstance(gc, GistComment)

        gcs = GistComment.gets_by_gist_id(gist.id)
        eq_(len(gcs), 1)

        assert gc.can_delete(user_id)

        gc.update(new_content)
        gc = GistComment.get(gc.id)

        eq_(gc.content, new_content)

        gc.delete()
        ret = GistComment.get(gc.id)
        eq_(ret, None)
예제 #2
0
    def test_gist_comment(self):
        gist = self._add_gist()
        user_id = 'testuser'
        content = 'xxoo'
        new_content = 'ooxx'

        gc = GistComment.add(gist.id, user_id, content)
        assert isinstance(gc, GistComment)

        gcs = GistComment.gets_by_gist_id(gist.id)
        eq_(len(gcs), 1)

        assert gc.can_delete(user_id)

        gc.update(new_content)
        gc = GistComment.get(gc.id)

        eq_(gc.content, new_content)

        gc.delete()
        ret = GistComment.get(gc.id)
        eq_(ret, None)
예제 #3
0
파일: gist.py 프로젝트: 000fan000/code
 def comments(self):
     return GistComment.gets_by_gist_id(self.id)
예제 #4
0
 def comments(self):
     return GistComment.gets_by_gist_id(self.id)