예제 #1
0
 def test_wiki_pages_that_do_not_exist_do_not_get_cloned(self):
     project = ProjectFactory(creator=self.user, is_public=True)
     wiki = NodeWikiFactory(node=project)
     NodeWikiPage.remove_one(wiki._id)
     # deleted wiki record in node.wiki_pages_versions
     assert_in(wiki._id, project.wiki_pages_versions[wiki.page_name])
     main()
     project.reload()
     # wiki_id gets removed from node.wiki_pages_versions
     assert_not_in(wiki._id, project.wiki_pages_versions[wiki.page_name])
예제 #2
0
 def test_wiki_pages_that_do_not_exist_do_not_get_cloned(self):
     project = ProjectFactory(creator=self.user, is_public=True)
     wiki = NodeWikiFactory(node=project)
     NodeWikiPage.remove_one(wiki._id)
     # deleted wiki record in node.wiki_pages_versions
     assert_in(wiki._id, project.wiki_pages_versions[wiki.page_name])
     main()
     project.reload()
     # wiki_id gets removed from node.wiki_pages_versions
     assert_not_in(wiki._id, project.wiki_pages_versions[wiki.page_name])
예제 #3
0
def move_to_backup_collection(node_wiki_page):
    db[BACKUP_COLLECTION].insert(node_wiki_page.to_storage())
    NodeWikiPage.remove_one(Q('_id', 'eq', node_wiki_page._id))
예제 #4
0
def move_to_backup_collection(node_wiki_page):
    db[BACKUP_COLLECTION].insert(node_wiki_page.to_storage())
    NodeWikiPage.remove_one(Q('_id', 'eq', node_wiki_page._id))