예제 #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))
예제 #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))
예제 #3
0
 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))
예제 #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'))
예제 #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')
     )
예제 #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)
예제 #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)