image_comment_tests.py 文件源码

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

项目:mltshp 作者: MLTSHP 项目源码 文件源码
def test_delete_anothers_comment_on_own_file(self):
        """
        A user can delete another's comment on their own sharedfile.
        """
        admins_sharedfile = test.factories.sharedfile(self.admin)
        comment = models.Comment(user_id=self.bob.id, sharedfile_id=admins_sharedfile.id, body="just a comment")
        comment.save()
        self.sign_in('admin', 'asdfasdf')
        self.assertEqual(None, models.Comment.get("id = %s and deleted = 1", comment.id))
        response = self.post_url("/p/%s/comment/%s/delete" % (admins_sharedfile.share_key, comment.id))
        self.assertEqual(comment.id, models.Comment.get("id = %s and deleted = 1", comment.id).id)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号