sharedfile_tests.py 文件源码

python
阅读 23 收藏 0 点赞 0 评论 0

项目:mltshp 作者: MLTSHP 项目源码 文件源码
def test_comment_count(self):
        """
        Comment count should return the number of comments belonging to
        shard file. Should not count deleted comments.
        """
        self.assertEqual(0, self.sharedfile.comment_count())
        comment = Comment(sharedfile_id=self.sharedfile.id, user_id=self.user.id, body="just a comment")
        comment.save()
        self.assertEqual(1, self.sharedfile.comment_count())
        comment = Comment(sharedfile_id=self.sharedfile.id, user_id=self.user.id, body="just a comment", deleted=True)
        comment.save()
        self.assertEqual(1, self.sharedfile.comment_count())
评论列表


问题


面经


文章

微信
公众号

扫码关注公众号