From: shh42 <svn...@pl...> - 2005-01-28 22:25:43
|
Author: shh42 Date: Fri Jan 28 17:20:08 2005 New Revision: 5940 Modified: CMFPlone/branches/tiran-atct-integration/tests/testGroupsTool.py CMFPlone/branches/tiran-atct-integration/tests/testOrderSupport.py CMFPlone/branches/tiran-atct-integration/tests/testPloneTool.py CMFPlone/branches/tiran-atct-integration/tests/testPortalCreation.py CMFPlone/branches/tiran-atct-integration/tests/testQueryCatalog.py CMFPlone/branches/tiran-atct-integration/tests/testWebDAV.py Log: Massage the tests to minimize differences with 2.1 branch. Modified: CMFPlone/branches/tiran-atct-integration/tests/testGroupsTool.py ============================================================================== --- CMFPlone/branches/tiran-atct-integration/tests/testGroupsTool.py (original) +++ CMFPlone/branches/tiran-atct-integration/tests/testGroupsTool.py Fri Jan 28 17:20:08 2005 @@ -162,9 +162,6 @@ self.prefix = self.acl_users.getGroupPrefix() self.groups.groupWorkspacesCreationFlag = 0 self.portal.manage_addPortalFolder(self.groups.getGroupWorkspacesFolderId()) - # Set role to Manager to allow overrideDiscussionFor of ATCT based - # folders. Without login this method raises Unauthorized - self.setRoles(['Manager']) def testGetGroupWorkspacesFolder(self): self.failIfEqual(self.groups.getGroupWorkspacesFolder(), None) Modified: CMFPlone/branches/tiran-atct-integration/tests/testOrderSupport.py ============================================================================== --- CMFPlone/branches/tiran-atct-integration/tests/testOrderSupport.py (original) +++ CMFPlone/branches/tiran-atct-integration/tests/testOrderSupport.py Fri Jan 28 17:20:08 2005 @@ -65,64 +65,48 @@ self.assertEqual(self.folder.getObjectPosition('bar'), 2) def testMoveObjectsUp(self): - # XXX: Should return the number of objects moved - #self.assertEqual(self.folder.moveObjectsUp(['bar']), 1) self.folder.moveObjectsUp(['bar']) self.assertEqual(self.folder.getObjectPosition('bar'), 0) self.assertEqual(self.folder.getObjectPosition('foo'), 1) self.assertEqual(self.folder.getObjectPosition('baz'), 2) def testMoveObjectsDown(self): - # XXX: Should return the number of objects moved - #self.assertEqual(self.folder.moveObjectsDown(['bar']), 1) self.folder.moveObjectsDown(['bar']) self.assertEqual(self.folder.getObjectPosition('foo'), 0) self.assertEqual(self.folder.getObjectPosition('baz'), 1) self.assertEqual(self.folder.getObjectPosition('bar'), 2) def testMoveObjectsToTop(self): - # XXX: Should return the number of objects moved - #self.assertEqual(self.folder.moveObjectsToTop(['bar']), 1) self.folder.moveObjectsToTop(['bar']) self.assertEqual(self.folder.getObjectPosition('bar'), 0) self.assertEqual(self.folder.getObjectPosition('foo'), 1) self.assertEqual(self.folder.getObjectPosition('baz'), 2) def testMoveObjectsToBottom(self): - # XXX: Should return the number of objects moved - #self.assertEqual(self.folder.moveObjectsToBottom(['bar']), 1) self.folder.moveObjectsToBottom(['bar']) self.assertEqual(self.folder.getObjectPosition('foo'), 0) self.assertEqual(self.folder.getObjectPosition('baz'), 1) self.assertEqual(self.folder.getObjectPosition('bar'), 2) def testMoveTwoObjectsUp(self): - # XXX: Should return the number of objects moved - #self.assertEqual(self.folder.moveObjectsUp(['bar', 'baz']), 2) self.folder.moveObjectsUp(['bar', 'baz']) self.assertEqual(self.folder.getObjectPosition('bar'), 0) self.assertEqual(self.folder.getObjectPosition('baz'), 1) self.assertEqual(self.folder.getObjectPosition('foo'), 2) def testMoveTwoObjectsDown(self): - # XXX: Should return the number of objects moved - #self.assertEqual(self.folder.moveObjectsDown(['foo', 'bar']), 2) self.folder.moveObjectsDown(['foo', 'bar']) self.assertEqual(self.folder.getObjectPosition('baz'), 0) self.assertEqual(self.folder.getObjectPosition('foo'), 1) self.assertEqual(self.folder.getObjectPosition('bar'), 2) def testMoveTwoObjectsToTop(self): - # XXX: Should return the number of objects moved - #self.assertEqual(self.folder.moveObjectsToTop(['bar', 'baz']), 2) self.folder.moveObjectsToTop(['bar', 'baz']) self.assertEqual(self.folder.getObjectPosition('bar'), 0) self.assertEqual(self.folder.getObjectPosition('baz'), 1) self.assertEqual(self.folder.getObjectPosition('foo'), 2) def testMoveTwoObjectsToBottom(self): - # XXX: Should return the number of objects moved - #self.assertEqual(self.folder.moveObjectsToBottom(['foo', 'bar']), 2) self.folder.moveObjectsToBottom(['foo', 'bar']) self.assertEqual(self.folder.getObjectPosition('baz'), 0) self.assertEqual(self.folder.getObjectPosition('foo'), 1) @@ -246,7 +230,7 @@ def test_suite(): from unittest import TestSuite, makeSuite suite = TestSuite() - ##suite.addTest(makeSuite(TestOrderSupport)) + suite.addTest(makeSuite(TestOrderSupport)) suite.addTest(makeSuite(TestOrderSupportInPortal)) return suite Modified: CMFPlone/branches/tiran-atct-integration/tests/testPloneTool.py ============================================================================== --- CMFPlone/branches/tiran-atct-integration/tests/testPloneTool.py (original) +++ CMFPlone/branches/tiran-atct-integration/tests/testPloneTool.py Fri Jan 28 17:20:08 2005 @@ -28,8 +28,8 @@ self.assertEqual(doc.get_local_roles_for_userid(default_user), ('Owner',)) self.utils.changeOwnershipOf(doc, 'new_owner') - self.assertEqual(doc.get_local_roles_for_userid('new_owner'), ('Owner',)) self.assertEqual(doc.getOwnerTuple()[1], 'new_owner') + self.assertEqual(doc.get_local_roles_for_userid('new_owner'), ('Owner',)) # Initial creator no longer has Owner role. self.assertEqual(doc.get_local_roles_for_userid(default_user), ()) @@ -128,21 +128,6 @@ self.assertEqual(self.folder.image.Format(), 'image/gif') self.assertEqual(self.folder.image.getImage().content_type, 'image/gif') - def testEditFormatMetadataOfDocument(self): - # Test workaround for http://plone.org/collector/1323 - # Also see setFormatPatch.py - self.folder.invokeFactory('Document', id='doc', - text_format='text/plain', text='foo') - # Documents don't have a content_type property! - self.failIf(self.folder.doc.hasProperty('content_type')) - self.assertEqual(self.folder.doc.Format(), 'text/plain') - self.assertEqual(self.folder.doc.content_type, 'text/plain') - # Changing the format should not create the property - self.utils.editMetadata(self.folder.doc, format='text/html') - self.failIf(self.folder.doc.hasProperty('content_type')) - self.assertEqual(self.folder.doc.Format(), 'text/html') - self.assertEqual(self.folder.doc.content_type, 'text/html') - class TestEditMetadata(PloneTestCase.PloneTestCase): @@ -269,13 +254,10 @@ # Note that empty entries are filtered self.assertEqual(self.doc.Subject(), ('Foo', 'Bar', 'Baz')) - def testTuplifySubject_3(self): + def DISABLED_testTuplifySubject_3(self): self.utils.editMetadata(self.doc, subject='Foo, Bar, Baz') # XXX: Wishful thinking - #self.assertEqual(self.doc.Subject(), ('Foo', 'Bar', 'Baz')) - # XXX AT doesn't add an extra space after the delimiter - #self.assertEqual(self.doc.Subject(), ('F','o','o',',','','B','a','r',',','','B','a','z')) - self.assertEqual(self.doc.Subject(), ('F','o','o',',','B','a','r',',','B','a','z')) + self.assertEqual(self.doc.Subject(), ('Foo', 'Bar', 'Baz')) def testTuplifyContributors_1(self): self.utils.editMetadata(self.doc, contributors=['Foo', 'Bar', 'Baz']) @@ -286,13 +268,10 @@ # Note that empty entries are filtered self.assertEqual(self.doc.Contributors(), ('Foo', 'Bar', 'Baz')) - def testTuplifyContributors_3(self): + def DISABLED_testTuplifyContributors_3(self): self.utils.editMetadata(self.doc, contributors='Foo; Bar; Baz') # XXX: Wishful thinking - #self.assertEqual(self.doc.Contributors(), ('Foo', 'Bar', 'Baz')) - # XXX AT doesn't add an extra space after the delimiter - #self.assertEqual(self.doc.Contributors(), ('F','o','o',';','','B','a','r',';','','B','a','z')) - self.assertEqual(self.doc.Contributors(), ('F','o','o',';','B','a','r',';','B','a','z')) + self.assertEqual(self.doc.Contributors(), ('Foo', 'Bar', 'Baz')) class TestEditMetadataIndependence(PloneTestCase.PloneTestCase): Modified: CMFPlone/branches/tiran-atct-integration/tests/testPortalCreation.py ============================================================================== --- CMFPlone/branches/tiran-atct-integration/tests/testPortalCreation.py (original) +++ CMFPlone/branches/tiran-atct-integration/tests/testPortalCreation.py Fri Jan 28 17:20:08 2005 @@ -126,16 +126,10 @@ def testImagePatch(self): # Is it ok to remove the imagePatch? Probably not as we # don't want the border attribute ... - factory = self.folder.manage_addProduct['OFSP'] - factory.manage_addImage('foo', file=dummy.Image()) + self.folder.invokeFactory('Image', id='foo', file=dummy.Image()) endswith = ' alt="" title="" longdesc="" height="16" width="16" />' self.assertEqual(self.folder.foo.tag()[-len(endswith):], endswith) - def testATImagePatch(self): - # XXX: imagePatch does not apply to ATImages! - self.folder.invokeFactory('Image', id='foo', file=dummy.Image()) - endswith = ' alt="" title="" width="16" height="16" />' - self.assertEqual(self.folder.foo.tag()[-len(endswith):], endswith) def testNoPortalFormTool(self): # portal_form should have been removed self.failIf('portal_form' in self.portal.objectIds()) @@ -194,14 +188,6 @@ self.app._delObject(PloneTestCase.portal_name) self.failUnless(self.foo.before_delete_called()) - def testMembersFolderIsOk(self): - # Fixed by ATCT _fixLargePloneFolder() - members = self.membership.getMembersFolder() - self.failUnlessEqual(members._getPortalTypeName(), 'Large Plone Folder') - tinfo = members.getTypeInfo() - self.failIfEqual(tinfo, None) - self.failUnlessEqual(tinfo.getId(), 'Large Plone Folder') - class TestManagementPageCharset(PloneTestCase.PloneTestCase): Modified: CMFPlone/branches/tiran-atct-integration/tests/testQueryCatalog.py ============================================================================== --- CMFPlone/branches/tiran-atct-integration/tests/testQueryCatalog.py (original) +++ CMFPlone/branches/tiran-atct-integration/tests/testQueryCatalog.py Fri Jan 28 17:20:08 2005 @@ -11,7 +11,7 @@ from Acquisition import aq_base from Products.ZCTextIndex.ParseTree import ParseError -from Products.ZCatalog.Lazy import LazyCat +from Products.ZCatalog.Lazy import LazyCat try: import Products.TextIndexNG2 Modified: CMFPlone/branches/tiran-atct-integration/tests/testWebDAV.py ============================================================================== --- CMFPlone/branches/tiran-atct-integration/tests/testWebDAV.py (original) +++ CMFPlone/branches/tiran-atct-integration/tests/testWebDAV.py Fri Jan 28 17:20:08 2005 @@ -69,7 +69,7 @@ self.assertEqual(doc.Contributors(), ()) self.assertEqual(doc.EffectiveDate(), 'None') self.assertEqual(doc.ExpirationDate(), 'None') - self.assertEqual(doc.Language(), '') + self.assertEqual(doc.Language(), 'en') self.assertEqual(doc.Rights(), '') |