本文整理汇总了Python中tests.factories.NodeFactory.has_addon方法的典型用法代码示例。如果您正苦于以下问题:Python NodeFactory.has_addon方法的具体用法?Python NodeFactory.has_addon怎么用?Python NodeFactory.has_addon使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类tests.factories.NodeFactory
的用法示例。
在下文中一共展示了NodeFactory.has_addon方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_migrate_wiki
# 需要导入模块: from tests.factories import NodeFactory [as 别名]
# 或者: from tests.factories.NodeFactory import has_addon [as 别名]
def test_migrate_wiki(self):
node = NodeFactory()
wiki_addon = node.get_addon('wiki')
AddonWikiNodeSettings.remove_one(wiki_addon)
assert_false(node.has_addon('wiki'))
was_migrated = migrate_addons(node)
assert_true(was_migrated)
assert_true(node.has_addon('wiki'))
示例2: test_migrate_osffiles
# 需要导入模块: from tests.factories import NodeFactory [as 别名]
# 或者: from tests.factories.NodeFactory import has_addon [as 别名]
def test_migrate_osffiles(self):
node = NodeFactory()
osf_addon = node.get_addon('osffiles')
AddonFilesNodeSettings.remove_one(osf_addon)
assert_false(node.has_addon('osffiles'))
was_migrated = migrate_addons(node)
assert_true(was_migrated)
assert_true(node.has_addon('osffiles'))
示例3: test_affected_nodes
# 需要导入模块: from tests.factories import NodeFactory [as 别名]
# 或者: from tests.factories.NodeFactory import has_addon [as 别名]
def test_affected_nodes(self):
affected_node = NodeFactory()
AddonWikiNodeSettings.remove_one(affected_node.get_addon('wiki'))
assert_false(affected_node.has_addon('wiki'))
unaffected_node = NodeFactory()
assert_true(unaffected_node.has_addon('wiki'))
affected_nodes = list(get_affected_nodes(self.db, AddonWikiNodeSettings))
assert_in(affected_node, affected_nodes)
assert_not_in(unaffected_node, affected_nodes)
示例4: test_no_migration_if_addon_exists
# 需要导入模块: from tests.factories import NodeFactory [as 别名]
# 或者: from tests.factories.NodeFactory import has_addon [as 别名]
def test_no_migration_if_addon_exists(self):
node = NodeFactory()
assert_true(node.has_addon('wiki'))
assert_true(node.has_addon('osffiles'))
migrate_nodes(self.db)
assert_false(migrate_addons(node))