

def test_forward_slash_is_removed_from_wiki_title(self):
    project = ProjectFactory()
    wiki = NodeWikiFactory(node=project, is_current=True)
    invalid_name = 'invalid/name'
    db.nodewikipage.update({
        '_id': wiki._id,
    }, {
        '$set': {
            'page_name': invalid_name,
        },
    })
    project.wiki_pages_current['invalid/name'] = project.wiki_pages_current[wiki.page_name]
    project.wiki_pages_versions['invalid/name'] = project.wiki_pages_versions[wiki.page_name]
    project.save()
    main()
    wiki.reload()
    assert_equal(wiki.page_name, 'invalidname')
    assert_in('invalidname', project.wiki_pages_current)
    assert_in('invalidname', project.wiki_pages_versions)

dataset/ETHPy150Open CenterForOpenScience/osf.io/scripts/tests/test_remove_wiki_title_forward_slashes.py TestRemoveWikiTitleForwardSlashes.test_forward_slash_is_removed_from_wiki_title/original