本文整理汇总了Python中kitsune.wiki.tests.DocumentFactory.is_majorly_outdated方法的典型用法代码示例。如果您正苦于以下问题:Python DocumentFactory.is_majorly_outdated方法的具体用法?Python DocumentFactory.is_majorly_outdated怎么用?Python DocumentFactory.is_majorly_outdated使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类kitsune.wiki.tests.DocumentFactory
的用法示例。
在下文中一共展示了DocumentFactory.is_majorly_outdated方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_majorly_outdated_with_unapproved_parents
# 需要导入模块: from kitsune.wiki.tests import DocumentFactory [as 别名]
# 或者: from kitsune.wiki.tests.DocumentFactory import is_majorly_outdated [as 别名]
def test_majorly_outdated_with_unapproved_parents(self):
"""Migrations might introduce translated revisions without based_on
set. Tolerate these.
If based_on of a translation's current_revision is None, the
translation should be considered out of date iff any
major-significance, approved revision to the English article exists.
"""
# Create a parent doc with only an unapproved revision...
parent_rev = RevisionFactory()
# ...and a translation with a revision based on nothing.
trans = DocumentFactory(parent=parent_rev.document, locale='de')
trans_rev = RevisionFactory(document=trans, is_approved=True)
assert trans_rev.based_on is None, \
('based_on defaulted to something non-None, which this test '
"wasn't expecting.")
assert not trans.is_majorly_outdated(), \
('A translation was considered majorly out of date even though '
'the English document has never had an approved revision of '
'major significance.')
ApprovedRevisionFactory(
document=parent_rev.document,
significance=MAJOR_SIGNIFICANCE,
is_ready_for_localization=True)
assert trans.is_majorly_outdated(), \
('A translation was not considered majorly outdated when its '
"current revision's based_on value was None.")