def test_fakeserver_updatePage(): s = FakeConfluenceServer() # Updating an existing page: pid = '524296' p1 = s.getPage(pid) p1_org = copy.deepcopy(p1) p2 = copy.deepcopy(p1) assert p2['id'] == pid p2['content'] = "New content" p3 = s.storePage(p2) assert p3['content'] == "New content" assert p3['modifier'] == s.Username assert int(p3['version']) == int(p1_org['version']) + 1
def test_fakeserver_storePage(): s = FakeConfluenceServer() # Updating an existing page: pid = '524296' p1 = s.getPage(pid) p1_org = copy.deepcopy(p1) p2 = copy.deepcopy(p1) assert p2['id'] == pid p2['content'] = "New content" p3 = s.storePage(p2) assert p3['content'] == "New content" assert p3['creator'] == p1_org['creator'] assert p3['modifier'] == s.Username assert int(p3['version']) == int(p1_org['version']) + 1 ## Adding a new page: new_page = dict(content="new page content", space="~scholer", title="New testing page") ret_page = s.storePage(new_page) assert ret_page['content'] == "new page content" assert ret_page['creator'] == s.Username assert ret_page['modifier'] == s.Username assert ret_page['version'] == str(1)