def testIsSaneBTreeFolder(self): # positive case _createObjectByType('Folder', self.portal, 'btree') self.failUnless(isSaneBTreeFolder(self.portal.btree)) # negative case create('Folder', self.portal, 'folder') self.failIf(isSaneBTreeFolder(self.portal.folder)) reverseMigrate(self.portal.folder) self.failIf(isSaneBTreeFolder(self.portal.folder))
def testIsSaneBTreeFolder(self): # positive case _createObjectByType('Folder', self.portal, 'btree') self.assertTrue(isSaneBTreeFolder(self.portal.btree)) # negative case create('Folder', self.portal, 'folder') self.assertFalse(isSaneBTreeFolder(self.portal.folder)) reverseMigrate(self.portal.folder) self.assertFalse(isSaneBTreeFolder(self.portal.folder))
def create(container, nr): obj = _createObjectByType('Document', container, 'doc.%d' % nr) obj.setTitle('Title for %d' % nr) obj.setDescription('A long description for %d' % nr) obj.setText( 'This is the <b>HTML</b> text for item with id %d' % nr) obj.reindexObject(idxs=('Title', 'Description', 'SearchableText'))
def create(container, nr): obj = _createObjectByType('Document', container, 'doc.%d' % nr) obj.setTitle('Title for %d' % nr) obj.setDescription('A long description for %d' % nr) obj.setText( 'This is the <b>HTML</b> text for item with id %d' % nr ) obj.reindexObject( idxs=('Title', 'Description', 'SearchableText') )
def setUp(cls): app = ztc.app() portal = app.plone def create(container, nr): obj = _createObjectByType('Document', container, 'doc.%d' % nr) obj.setTitle('Title for %d' % nr) obj.setDescription('A long description for %d' % nr) obj.setText( 'This is the <b>HTML</b> text for item with id %d' % nr ) obj.reindexObject( idxs=('Title', 'Description', 'SearchableText') ) regular = createNonBTreeFolder('Folder', portal, 'regular') unordered = _createObjectByType('Folder', portal, 'unordered') unordered.setOrdering(u'unordered') ordered = _createObjectByType('Folder', portal, 'ordered') @timecall def testCreateContentRegular(): for x in range(SIZE): create(regular, x) @timecall def testCreateContentUnordered(): for x in range(SIZE): create(unordered, x) @timecall def testCreateContentOrdered(): for x in range(SIZE): create(ordered, x) testCreateContentRegular() testCreateContentUnordered() testCreateContentOrdered() commit() ztc.close(app)
def setUp(cls): app = ztc.app() portal = app.plone def create(container, nr): obj = _createObjectByType('Document', container, 'doc.%d' % nr) obj.setTitle('Title for %d' % nr) obj.setDescription('A long description for %d' % nr) obj.setText( 'This is the <b>HTML</b> text for item with id %d' % nr) obj.reindexObject(idxs=('Title', 'Description', 'SearchableText')) regular = createNonBTreeFolder('Folder', portal, 'regular') unordered = _createObjectByType('Folder', portal, 'unordered') unordered.setOrdering(u'unordered') ordered = _createObjectByType('Folder', portal, 'ordered') @timecall def testCreateContentRegular(): for x in range(SIZE): create(regular, x) @timecall def testCreateContentUnordered(): for x in range(SIZE): create(unordered, x) @timecall def testCreateContentOrdered(): for x in range(SIZE): create(ordered, x) testCreateContentRegular() testCreateContentUnordered() testCreateContentOrdered() commit() ztc.close(app)