本文整理汇总了Python中tests.factories.CommentFactory.get_content方法的典型用法代码示例。如果您正苦于以下问题:Python CommentFactory.get_content方法的具体用法?Python CommentFactory.get_content怎么用?Python CommentFactory.get_content使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类tests.factories.CommentFactory
的用法示例。
在下文中一共展示了CommentFactory.get_content方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_get_content_private_project_throws_permissions_error_for_logged_out_users
# 需要导入模块: from tests.factories import CommentFactory [as 别名]
# 或者: from tests.factories.CommentFactory import get_content [as 别名]
def test_get_content_private_project_throws_permissions_error_for_logged_out_users(self):
project = ProjectFactory(is_public=False)
comment = CommentFactory(node=project, is_deleted=True)
with assert_raises(PermissionsError):
comment.get_content(auth=None)
示例2: test_get_content_public_project_does_not_return_deleted_content_to_logged_out_user
# 需要导入模块: from tests.factories import CommentFactory [as 别名]
# 或者: from tests.factories.CommentFactory import get_content [as 别名]
def test_get_content_public_project_does_not_return_deleted_content_to_logged_out_user(self):
project = ProjectFactory(is_public=True)
comment = CommentFactory(node=project, is_deleted=True)
content = comment.get_content(auth=None)
assert_is_none(content)
示例3: test_get_content_returns_deleted_content_to_commenter
# 需要导入模块: from tests.factories import CommentFactory [as 别名]
# 或者: from tests.factories.CommentFactory import get_content [as 别名]
def test_get_content_returns_deleted_content_to_commenter(self):
comment = CommentFactory(is_deleted=True)
content = comment.get_content(auth=Auth(comment.user))
assert_equal(content, comment.content)
示例4: test_get_content_does_not_return_deleted_content_to_non_commenter
# 需要导入模块: from tests.factories import CommentFactory [as 别名]
# 或者: from tests.factories.CommentFactory import get_content [as 别名]
def test_get_content_does_not_return_deleted_content_to_non_commenter(self):
user = AuthUserFactory()
comment = CommentFactory(is_deleted=True)
content = comment.get_content(auth=Auth(user))
assert_is_none(content)
示例5: test_get_content_for_not_deleted_comment
# 需要导入模块: from tests.factories import CommentFactory [as 别名]
# 或者: from tests.factories.CommentFactory import get_content [as 别名]
def test_get_content_for_not_deleted_comment(self):
project = ProjectFactory(is_public=True)
comment = CommentFactory(node=project)
content = comment.get_content(auth=Auth(comment.user))
assert_equal(content, comment.content)