diff --git a/floop/__init__.pyc b/floop/__init__.pyc new file mode 100644 index 0000000..b05ca28 --- /dev/null +++ b/floop/__init__.pyc Binary files differ diff --git a/floop/migration/__init__.pyc b/floop/migration/__init__.pyc new file mode 100644 index 0000000..24c9a7d --- /dev/null +++ b/floop/migration/__init__.pyc Binary files differ diff --git a/floop/migration/migrate.py b/floop/migration/migrate.py index 9ad062d..58d15d7 100644 --- a/floop/migration/migrate.py +++ b/floop/migration/migrate.py @@ -27,7 +27,7 @@ self.new.setTitle(self.old.title) def migrate_owner(self): - self.new._owner = self.old.creator + self.new.setCreators([self.old.creator]) def last_migrate_date(self): self.new.creation_date = DateTime(self.old.creation_time) diff --git a/floop/migration/migrate.pyc b/floop/migration/migrate.pyc new file mode 100644 index 0000000..e02a299 --- /dev/null +++ b/floop/migration/migrate.pyc Binary files differ diff --git a/floop/migration/tests/__init__.pyc b/floop/migration/tests/__init__.pyc new file mode 100644 index 0000000..f4bb64b --- /dev/null +++ b/floop/migration/tests/__init__.pyc Binary files differ diff --git a/floop/migration/tests/base.pyc b/floop/migration/tests/base.pyc new file mode 100644 index 0000000..670c164 --- /dev/null +++ b/floop/migration/tests/base.pyc Binary files differ diff --git a/floop/migration/tests/test_migration.py b/floop/migration/tests/test_migration.py index 4718fdd..76aa7b1 100644 --- a/floop/migration/tests/test_migration.py +++ b/floop/migration/tests/test_migration.py @@ -8,21 +8,18 @@ """ def afterSetUp(self): #Create an object to migrate - addZWikiPage(self.folder, 'test_oldtype', 'Test Title') - # self.folder.invokeFactory('Wiki Page', 'test_oldtype') - - #A direct assignment doesn't work here, you have to use the setter or - #the value will come out blank. - #The field migrator uses obj.getRawFieldName() - self.folder.test_oldtype.setText('Some random wiki text\n\n * With some bullets\n') - + self.membership = self.portal.portal_membership + self.membership.addMember('new_owner', 'secret', ['Member'], []) + self.folder.manage_addProduct['ZWiki'].manage_addZWikiPage('TestPage') + self.folder.TestPage.setText('Some random wiki text\n\n * With some bullets\n') + self.folder.TestPage.creator = 'new_owner' #Need this to avoid copy errors transaction.savepoint(optimistic=True) def testItemMigrated(self): #portal_type and meta_type should be of type newtype - oldItem = self.folder.test_oldtype + oldItem = self.folder.TestPage ###Before the migration self.assertEqual(oldItem.portal_type, "Wiki Page", @@ -37,7 +34,7 @@ ###After the migration #Recopy the item, the old object held on to that old type info - newItem = self.folder.test_oldtype + newItem = self.folder.TestPage #The item should now have the new types self.assertEqual(newItem.portal_type, "Document", @@ -52,6 +49,7 @@ self.assertEqual(newItem.getField('text').getContentType(newItem), 'text/structured') self.assertEqual(newItem.getText(), '

Some random wiki text

\n\n\n', 'text field did not transfer') + self.assertEqual(newItem.Creator(), 'new_owner', 'Owner did not transfer.') def test_suite(): diff --git a/floop/migration/tests/test_migration.pyc b/floop/migration/tests/test_migration.pyc new file mode 100644 index 0000000..4178adf --- /dev/null +++ b/floop/migration/tests/test_migration.pyc Binary files differ