image_comment_tests.py 文件源码

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

项目:mltshp 作者: MLTSHP 项目源码 文件源码
def test_can_not_delete_anothers_sharedfile(self):
        """
        A user can not delete someone else's comment if it's on a sharedfile they
        don't own.
        """
        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('tom', '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(None, models.Comment.get("id = %s and deleted = 1", comment.id))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号