def testFolderMigration(self):
     from plone.app.folder.tests.content import create
     from plone.app.folder.tests.test_migration import reverseMigrate
     from plone.app.folder.tests.test_migration import isSaneBTreeFolder
     # create a folder in an unmigrated state & check it's broken...
     folder = create('Folder', self.portal, 'foo', title='Foo')
     reverseMigrate(self.portal)
     self.assertFalse(isSaneBTreeFolder(self.portal.foo))
     # now run the migration step...
     migrateFolders(self.portal)
     folder = self.portal.foo
     self.assertTrue(isSaneBTreeFolder(folder))
     self.assertEqual(folder.getId(), 'foo')
     self.assertEqual(folder.Title(), 'Foo')
Exemple #2
0
 def testFolderMigration(self):
     from plone.app.folder.tests.content import create
     from plone.app.folder.tests.test_migration import reverseMigrate
     from plone.app.folder.tests.test_migration import isSaneBTreeFolder
     # create a folder in an unmigrated state & check it's broken...
     folder = create('Folder', self.portal, 'foo', title='Foo')
     reverseMigrate(self.portal)
     self.assertFalse(isSaneBTreeFolder(self.portal.foo))
     # now run the migration step...
     migrateFolders(self.portal)
     folder = self.portal.foo
     self.assertTrue(isSaneBTreeFolder(folder))
     self.assertEqual(folder.getId(), 'foo')
     self.assertEqual(folder.Title(), 'Foo')