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'))
 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'))
    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)
    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)