def test_non_owner_authenticated_user_delete_helpingmaterial(self):
"""Test authenticated user cannot delete a helpingmaterial if is not the post
owner and is not admin"""
owner = UserFactory.create(id=5)
project = ProjectFactory.create(owner=owner, published=True)
helpingmaterial = HelpingMaterialFactory.create(project_id=project.id)
assert self.mock_authenticated.id != owner.id
assert not self.mock_authenticated.admin
assert_raises(Forbidden, ensure_authorized_to, 'delete',
helpingmaterial)
test_helpingmaterial.py 文件源码
python
阅读 20
收藏 0
点赞 0
评论 0
评论列表
文章目录