当前位置: 首页>>代码示例>>Python>>正文


Python CommentFactory.is_deleted方法代码示例

本文整理汇总了Python中tests.factories.CommentFactory.is_deleted方法的典型用法代码示例。如果您正苦于以下问题:Python CommentFactory.is_deleted方法的具体用法?Python CommentFactory.is_deleted怎么用?Python CommentFactory.is_deleted使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在tests.factories.CommentFactory的用法示例。


在下文中一共展示了CommentFactory.is_deleted方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_private_node_logged_out_user_cannot_see_deleted_comment

# 需要导入模块: from tests.factories import CommentFactory [as 别名]
# 或者: from tests.factories.CommentFactory import is_deleted [as 别名]
 def test_private_node_logged_out_user_cannot_see_deleted_comment(self):
     self._set_up_private_project_with_comment()
     comment = CommentFactory(node=self.private_project, target=self.private_project, user=self.user)
     comment.is_deleted = True
     comment.save()
     url = '/{}comments/{}/'.format(API_BASE, comment._id)
     res = self.app.get(url, expect_errors=True)
     assert_equal(res.status_code, 401)
开发者ID:mchelen,项目名称:osf.io,代码行数:10,代码来源:test_comment_detail.py

示例2: test_public_node_logged_out_user_cannot_view_deleted_file_comments

# 需要导入模块: from tests.factories import CommentFactory [as 别名]
# 或者: from tests.factories.CommentFactory import is_deleted [as 别名]
 def test_public_node_logged_out_user_cannot_view_deleted_file_comments(self):
     self._set_up_public_project_with_file_comment()
     comment = CommentFactory(node=self.public_project, target=self.public_file, user=self.user)
     comment.is_deleted = True
     comment.save()
     url = '/{}comments/{}/'.format(API_BASE, comment._id)
     res = self.app.get(url)
     assert_equal(res.status_code, 200)
     assert_is_none(res.json['data']['attributes']['content'])
开发者ID:mchelen,项目名称:osf.io,代码行数:11,代码来源:test_comment_detail.py

示例3: test_private_node_logged_out_user_cannot_see_deleted_file_comment

# 需要导入模块: from tests.factories import CommentFactory [as 别名]
# 或者: from tests.factories.CommentFactory import is_deleted [as 别名]
 def test_private_node_logged_out_user_cannot_see_deleted_file_comment(self):
     self._set_up_private_project_with_file_comment()
     comment = CommentFactory(node=self.private_project, target=self.file, user=self.user)
     comment.is_deleted = True
     comment.save()
     url = '/{}comments/{}/'.format(API_BASE, comment._id)
     res = self.app.get(url, expect_errors=True)
     assert_equal(res.status_code, 401)
     assert_equal(res.json['errors'][0]['detail'], 'Authentication credentials were not provided.')
开发者ID:mchelen,项目名称:osf.io,代码行数:11,代码来源:test_comment_detail.py

示例4: test_private_node_contributor_cannot_see_other_users_deleted_file_comment

# 需要导入模块: from tests.factories import CommentFactory [as 别名]
# 或者: from tests.factories.CommentFactory import is_deleted [as 别名]
 def test_private_node_contributor_cannot_see_other_users_deleted_file_comment(self):
     self._set_up_private_project_with_file_comment()
     comment = CommentFactory(node=self.private_project, target=self.file, user=self.user)
     comment.is_deleted = True
     comment.save()
     url = '/{}comments/{}/'.format(API_BASE, comment._id)
     res = self.app.get(url, auth=self.contributor.auth)
     assert_equal(res.status_code, 200)
     assert_is_none(res.json['data']['attributes']['content'])
开发者ID:mchelen,项目名称:osf.io,代码行数:11,代码来源:test_comment_detail.py

示例5: test_public_node_non_contributor_cannot_view_other_users_deleted_comment

# 需要导入模块: from tests.factories import CommentFactory [as 别名]
# 或者: from tests.factories.CommentFactory import is_deleted [as 别名]
 def test_public_node_non_contributor_cannot_view_other_users_deleted_comment(self):
     public_project = ProjectFactory(is_public=True, creator=self.user)
     comment = CommentFactory(node=public_project, target=public_project, user=self.user)
     comment.is_deleted = True
     comment.save()
     url = '/{}comments/{}/'.format(API_BASE, comment._id)
     res = self.app.get(url, auth=self.non_contributor.auth)
     assert_equal(res.status_code, 200)
     assert_is_none(res.json['data']['attributes']['content'])
开发者ID:mchelen,项目名称:osf.io,代码行数:11,代码来源:test_comment_detail.py

示例6: test_private_node_only_logged_in_commenter_can_view_deleted_comment

# 需要导入模块: from tests.factories import CommentFactory [as 别名]
# 或者: from tests.factories.CommentFactory import is_deleted [as 别名]
 def test_private_node_only_logged_in_commenter_can_view_deleted_comment(self):
     self._set_up_private_project_with_comment()
     comment = CommentFactory(node=self.private_project, target=self.private_project, user=self.user)
     comment.is_deleted = True
     comment.save()
     url = '/{}comments/{}/'.format(API_BASE, comment._id)
     res = self.app.get(url, auth=self.user.auth)
     assert_equal(res.status_code, 200)
     assert_equal(res.json['data']['attributes']['content'], comment.content)
开发者ID:mchelen,项目名称:osf.io,代码行数:11,代码来源:test_comment_detail.py

示例7: test_private_node_only_logged_in_contributor_commenter_can_undelete_own_reply

# 需要导入模块: from tests.factories import CommentFactory [as 别名]
# 或者: from tests.factories.CommentFactory import is_deleted [as 别名]
 def test_private_node_only_logged_in_contributor_commenter_can_undelete_own_reply(self):
     self._set_up_private_project_with_comment()
     reply_target = Guid.load(self.comment._id)
     reply = CommentFactory(node=self.private_project, target=reply_target, user=self.user)
     reply_url = '/{}comments/{}/'.format(API_BASE, reply)
     reply.is_deleted = True
     reply.save()
     payload = self._set_up_payload(reply._id, has_content=False)
     res = self.app.patch_json_api(reply_url, payload, auth=self.user.auth)
     assert_equal(res.status_code, 200)
     assert_false(res.json['data']['attributes']['deleted'])
     assert_equal(res.json['data']['attributes']['content'], reply.content)
开发者ID:baylee-d,项目名称:osf.io,代码行数:14,代码来源:test_comment_detail.py


注:本文中的tests.factories.CommentFactory.is_deleted方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。