本文整理匯總了Python中osf_tests.factories.CommentFactory.is_deleted方法的典型用法代碼示例。如果您正苦於以下問題:Python CommentFactory.is_deleted方法的具體用法?Python CommentFactory.is_deleted怎麽用?Python CommentFactory.is_deleted使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類osf_tests.factories.CommentFactory
的用法示例。
在下文中一共展示了CommentFactory.is_deleted方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: test_private_node_only_logged_in_contributor_commenter_can_undelete_own_reply
# 需要導入模塊: from osf_tests.factories import CommentFactory [as 別名]
# 或者: from osf_tests.factories.CommentFactory import is_deleted [as 別名]
def test_private_node_only_logged_in_contributor_commenter_can_undelete_own_reply(
self, app, user, private_project, comment, set_up_payload):
reply_target = Guid.load(comment._id)
reply = CommentFactory(
node=private_project,
target=reply_target, user=user
)
reply_url = '/{}comments/{}/'.format(API_BASE, reply._id)
reply.is_deleted = True
reply.save()
payload = set_up_payload(reply._id, has_content=False)
res = app.patch_json_api(reply_url, payload, auth=user.auth)
assert res.status_code == 200
assert not res.json['data']['attributes']['deleted']
assert res.json['data']['attributes']['content'] == reply.content