From: Stefan H. H. <sh...@us...> - 2004-01-11 23:06:25
|
Update of /cvsroot/collective/ZopeTestCase In directory sc8-pr-cvs1:/tmp/cvs-serv31399 Modified Files: testZODBCompat.py Log Message: Define DummyObject higher up in the file. Index: testZODBCompat.py =================================================================== RCS file: /cvsroot/collective/ZopeTestCase/testZODBCompat.py,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- testZODBCompat.py 9 Jan 2004 16:47:31 -0000 1.12 +++ testZODBCompat.py 11 Jan 2004 23:06:22 -0000 1.13 @@ -14,10 +14,9 @@ from Testing import ZopeTestCase -import tempfile -from OFS.SimpleItem import SimpleItem from AccessControl.Permissions import add_documents_images_and_files from AccessControl.Permissions import delete_objects +import tempfile folder_name = ZopeTestCase.folder_name cutpaste_permissions = [add_documents_images_and_files, delete_objects] @@ -147,6 +146,21 @@ App.config.setConfiguration(config) +# Dummy object +from OFS.SimpleItem import SimpleItem + +class DummyObject(SimpleItem): + id = 'dummy' + foo = None + _v_foo = None + _p_foo = None + +app = ZopeTestCase.app() +app._setObject('dummy', DummyObject()) +get_transaction().commit() +ZopeTestCase.close(app) + + class TestSpecialAttributes(ZopeTestCase.ZopeTestCase): '''This testcase shows that _v_ and _p_ attributes are NOT bothered by transaction boundaries, but will keep their values across tests. @@ -166,7 +180,7 @@ ''' def afterSetUp(self): - self.dummy = self.app.dummy # See below for where dummy comes from + self.dummy = self.app.dummy # See above def testNormal_01(self): # foo is always None @@ -217,19 +231,6 @@ else: # XXX: _v_foo is transactional in Zope < 2.6 self.assertEqual(self.dummy._v_foo, None) - - -class DummyObject(SimpleItem): - id = 'dummy' - foo = None - _v_foo = None - _p_foo = None - -# Add a dummy object to the test ZODB -app = ZopeTestCase.app() -app._setObject('dummy', DummyObject()) -get_transaction().commit() -ZopeTestCase.close(app) class TestTransactionAbort(ZopeTestCase.ZopeTestCase): |