[CMF-checkins] CVS: Products/CMFDefault/tests -
test_DublinCore.py:1.6.2.2
Florent Guillaume
fg at nuxeo.com
Fri Mar 25 11:36:46 EST 2005
Update of /cvs-repository/Products/CMFDefault/tests
In directory cvs.zope.org:/tmp/cvs-serv29543/CMFDefault/tests
Modified Files:
Tag: CMF-1_5-branch
test_DublinCore.py
Log Message:
DublinCore: Fixed creators upgrade to not call a potentially costly
method on the user folder. (http://zope.org/Collectors/CMF/300)
=== Products/CMFDefault/tests/test_DublinCore.py 1.6.2.1 => 1.6.2.2 ===
--- Products/CMFDefault/tests/test_DublinCore.py:1.6.2.1 Tue Oct 12 05:22:52 2004
+++ Products/CMFDefault/tests/test_DublinCore.py Fri Mar 25 11:36:46 2005
@@ -104,6 +104,26 @@
item.setCreators( ('user_baz',) )
self.assertEqual( item.listCreators(), ('user_baz',) )
+ def test_creators_upgrade(self):
+ site = DummySite('site').__of__(self.root)
+ acl_users = site._setObject( 'acl_users', DummyUserFolder() )
+ site._setObject( 'portal_membership', MembershipTool() )
+ newSecurityManager(None, acl_users.user_foo)
+ item = self._makeDummyContent('item').__of__(site)
+ item.manage_fixupOwnershipAfterAdd()
+ # fake an old object < CMF 1.5 without creators
+ delattr(item, 'creators')
+ self.assertEqual(item.Creator(), 'user_foo')
+ newSecurityManager(None, acl_users.user_bar)
+ item.addCreator()
+ self.assertEqual(item.Creator(), 'user_foo')
+ self.assertEqual(item.listCreators(), ('user_foo', 'user_bar'))
+ # or if added directly
+ delattr(item, 'creators')
+ item.addCreator()
+ self.assertEqual(item.Creator(), 'user_foo')
+ self.assertEqual(item.listCreators(), ('user_foo', 'user_bar'))
+
def test_ceiling_parsable(self):
# Test that a None ceiling date will be parsable by a DateIndex
site = DummySite('site').__of__(self.root)
More information about the CMF-checkins
mailing list