def createTestDataForRollbackCanBeCancelled(cls, root_folder): # set up data that rollback-can-be-cancelled.txt expects root_folder['rbcbc'] = Folder() transaction.get().note(u"createTestDataForRollbackCanBeCancelled (1)") transaction.commit() root_folder['rbcbc'].random_attribute = 'hey' transaction.get().note(u"createTestDataForRollbackCanBeCancelled (2)") transaction.commit()
def createTestDataForRollbacking(cls, root_folder): # set up data that rollbacking.txt expects root_folder['rollbacking'] = Folder() transaction.get().note(u"createTestDataForRollbacking (1)") transaction.commit() root_folder['rollbacking'].random_attribute = 'hey' transaction.get().note(u"createTestDataForRollbacking (2)") transaction.commit()
def createTestDataForTruncation(cls, root_folder): # set up data that truncation.txt expects root_folder['longvalue'] = Folder() root_folder['longvalue'].long_attribute = u''' This is an attribute that has a rather long value. Because these happen sometimes in real life, and to display the entire very long string would be rather painful. So I'm adding some text here, not too much, but enough for the truncation logic to kick in. Is this enough? I hope so. ''' transaction.get().note(u"createTestDataForTruncation") transaction.commit()
def test_virtualhost_support(self): # we have to add a virtual host subsite folder1 = self.rootFolder['folder1'] subsite = Folder() sm = LocalSiteManager(folder1) subsite.setSiteManager(sm) folder1['subsite'] = subsite # add some more folder to the subsite subfolder1 = Folder() subsite['subfolder1'] = subfolder1 subfolder2 = Folder() subfolder2_1 = Folder() subfolder2['subfolder2_1'] = subfolder2_1 subsite['subfolder2'] = subfolder2 # set the virtualhost on the request request = TestRequest() request._vh_root = subsite # test virtual host root vh = request.getVirtualHostRoot() self.assertEquals(vh, subsite) rcxov = ReadContainerXmlObjectView treeView = rcxov(subsite, request).singleBranchTree check_xml(treeView(), util.read_output('test6.xml')) rcxov = ReadContainerXmlObjectView treeView = rcxov(subfolder1, request).singleBranchTree check_xml(treeView(), util.read_output('test7.xml')) rcxov = ReadContainerXmlObjectView treeView = rcxov(subfolder2_1, request).singleBranchTree check_xml(treeView(), util.read_output('test8.xml'))
def createTestDataForImplementsOnly(cls, root_folder): # set up data that implements-only.txt expects root_folder['io'] = Folder() root_folder['io'].crash = PersistentSubclassThatUsesImplementsOnly() transaction.commit()
def createTestDataForImplementsOnly(cls, root_folder): # set up data that implements-only.txt expects root_folder['io'] = Folder() root_folder['io'].crash = PersistentSubclassThatUsesImplementsOnly() transaction.get().note(u"createTestDataForImplementsOnly") transaction.commit()
def createTestDataForBrowsing(cls, root_folder): # set up data that browsing.txt expects root_folder['browsing'] = Folder() transaction.get().note(u"createTestDataForBrowsing") transaction.commit()