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


Python DocumentFactory.is_majorly_outdated方法代码示例

本文整理汇总了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.")
开发者ID:ChromiumEx,项目名称:kitsune,代码行数:34,代码来源:test_models.py


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