@@ -0,0 +1,1325 @@
+# -*- coding: utf-8 -*-%0Aimport sys%0Aimport logging%0Afrom website.app import setup_django, init_app%0Afrom scripts import utils as script_utils%0Afrom django.db import transaction%0A%0Asetup_django()%0Afrom osf.models import AbstractNode%0Afrom addons.wiki.models import WikiPage, WikiVersion%0A%0A%0Alogger = logging.getLogger(__name__)%0A%0Adef count_node_wiki_pages():%0A    %22%22%22%0A    Assert that counts for created WikiPages and WikiVersions are correct.%0A    %22%22%22%0A    nodes_with_wikis = AbstractNode.objects.exclude(wiki_pages_versions=%7B%7D).exclude(type='osf.collection').exclude(type='osf.quickfilesnode')%0A    wiki_page_count = 0%0A    wiki_version_counts = 0%0A    for node in nodes_with_wikis:%0A        for wiki_key, version_list in node.wiki_pages_versions.iteritems():%0A            wiki_page_count += 1%0A            wiki_version_counts += len(version_list)%0A    print %22%7B%7D wiki pages expected%22.format(wiki_page_count)%0A    print %22%7B%7D wiki versions expected%22.format(wiki_version_counts)%0A    assert wiki_page_count == WikiPage.objects.count()%0A    assert wiki_version_counts == WikiVersion.objects.count()%0A%0Adef main(dry=True):%0A    init_app(routes=False)%0A    count_node_wiki_pages()%0A%0Aif __name__ == '__main__':%0A    dry = '--dry' in sys.argv%0A    if not dry:%0A        script_utils.add_file_logger(logger, __file__)%0A    # Finally run the migration%0A    main(dry=dry)%0A

Add test script for verifying counts.