Beispiel #1
0
 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))
Beispiel #2
0
 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))
Beispiel #4
0
 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'))
Beispiel #5
0
 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')
     )
Beispiel #6
0
        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)
Beispiel #7
0
        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)