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