[CMF-checkins] CVS: CMF/CMFCore/tests - test_PortalFolder.py:1.30
Yvo Schubbe
y.2004_ at wcm-solutions.de
Mon Apr 12 16:56:58 EDT 2004
Update of /cvs-repository/CMF/CMFCore/tests
In directory cvs.zope.org:/tmp/cvs-serv32199
Modified Files:
test_PortalFolder.py
Log Message:
- fixed tests to work with Zope HEAD
=== CMF/CMFCore/tests/test_PortalFolder.py 1.29 => 1.30 ===
--- CMF/CMFCore/tests/test_PortalFolder.py:1.29 Mon Mar 8 08:46:09 2004
+++ CMF/CMFCore/tests/test_PortalFolder.py Mon Apr 12 16:56:56 2004
@@ -90,8 +90,6 @@
SecurityTest.setUp(self)
root = self.root
- try: root._delObject('test')
- except AttributeError: pass
root._setObject( 'test', PortalFolder( 'test','' ) )
def test_deletePropagation( self ):
@@ -215,12 +213,9 @@
self.failUnless( 'foo' in catalog.uniqueValuesFor('getId') )
assert has_path( catalog._catalog, '/test/folder/sub/foo' )
- # WAAAA! must get _p_jar set
- old, sub._p_jar = sub._p_jar, self.root._p_jar
- try:
- folder.manage_renameObject( id='sub', new_id='new_sub' )
- finally:
- sub._p_jar = old
+ get_transaction().commit(1)
+ folder.manage_renameObject(id='sub', new_id='new_sub')
+
self.failUnless( 'foo' in catalog.uniqueValuesFor('getId') )
assert len( catalog ) == 1
assert has_path( catalog._catalog, '/test/folder/new_sub/foo' )
@@ -238,13 +233,9 @@
sub2.all_meta_types.extend( sub2.all_meta_types )
sub2.all_meta_types.extend( extra_meta_types() )
- # WAAAA! must get _p_jar set
- old, bar._p_jar = sub._p_jar, self.root._p_jar
- try:
- cookie = folder.manage_cutObjects( ids=['bar'] )
- sub2.manage_pasteObjects( cookie )
- finally:
- bar._p_jar = old
+ get_transaction().commit(1)
+ cookie = folder.manage_cutObjects(ids=['bar'])
+ sub2.manage_pasteObjects(cookie)
self.failUnless( 'foo' in catalog.uniqueValuesFor('getId') )
self.failUnless( 'bar' in catalog.uniqueValuesFor('getId') )
@@ -361,17 +352,14 @@
assert has_path( catalog._catalog, '/test/sub2/dummy' )
assert not has_path( catalog._catalog, '/test/sub3/dummy' )
- # WAAAA! must get _p_jar set
- old, dummy._p_jar = dummy._p_jar, self.root._p_jar
- try:
- cookie = sub1.manage_cutObjects( ids = ( 'dummy', ) )
- # Waaa! force sub2 to allow paste of Dummy object.
- sub3.all_meta_types = []
- sub3.all_meta_types.extend( sub3.all_meta_types )
- sub3.all_meta_types.extend( extra_meta_types() )
- sub3.manage_pasteObjects( cookie )
- finally:
- dummy._p_jar = old
+ get_transaction().commit(1)
+ cookie = sub1.manage_cutObjects( ids = ('dummy',) )
+ # Waaa! force sub2 to allow paste of Dummy object.
+ sub3.all_meta_types = []
+ sub3.all_meta_types.extend(sub3.all_meta_types)
+ sub3.all_meta_types.extend( extra_meta_types() )
+ sub3.manage_pasteObjects(cookie)
+
assert not 'dummy' in sub1.objectIds()
assert not 'dummy' in sub1.contentIds()
assert 'dummy' in sub2.objectIds()
More information about the CMF-checkins
mailing list