[Zope3-checkins] CVS: zopeproducts/photo/tests - test_photo.py:1.2 test_size.py:1.2

Bjorn Tillenius bjoti777 at student.liu.se
Sun Sep 21 18:17:48 EDT 2003


Update of /cvs-repository/zopeproducts/photo/tests
In directory cvs.zope.org:/tmp/cvs-serv26937/tests

Modified Files:
	test_photo.py test_size.py 
Log Message:
Updated code to work after ParentGeddon and ReplaceSetObjectWithSetitem.


=== zopeproducts/photo/tests/test_photo.py 1.1 => 1.2 ===
--- zopeproducts/photo/tests/test_photo.py:1.1	Fri Aug 15 08:10:56 2003
+++ zopeproducts/photo/tests/test_photo.py	Sun Sep 21 18:17:48 2003
@@ -78,19 +78,16 @@
     def makeTestData(self):
         return DefaultTestData()
 
-    def _makeContextPhotoInsidePc(self):
-        # Makes a photo inside a PhotoContainer and context wraps it
+    def _makePhotoInsidePc(self):
         self.createRootFolder()
         pc = PhotoContainer()
-        ph = zapi.ContextWrapper(Photo(), pc)
-        pc.setObject('a', ph)
-        pc = zapi.ContextWrapper(pc, self.rootFolder)
-        self.rootFolder.setObject('pc', pc)
+        pc['a'] = Photo()
+        self.rootFolder['pc'] = pc
         photo = zapi.traverseName(pc, 'a')
         return photo
         
     def test_interface(self):
-        photo = self._makeContextPhotoInsidePc()
+        photo = self._makePhotoInsidePc()
         verifyObject(IPhoto, photo)
 
 
@@ -109,7 +106,7 @@
 
 
     def test_currentDisplayId(self):
-        photo = self._makeContextPhotoInsidePc()
+        photo = self._makePhotoInsidePc()
         photo.useParentOptions = False
         photo.currentDisplayId = 'original'
         self.assertEqual(photo.currentDisplayId, 'original')
@@ -136,7 +133,7 @@
 
 
     def test_getImage(self):
-        photo = self._makeContextPhotoInsidePc()
+        photo = self._makePhotoInsidePc()
         photo.data = zptlogo
         org = photo.getImage('original')
         self.assertEqual(org.data, zptlogo)


=== zopeproducts/photo/tests/test_size.py 1.1 => 1.2 ===
--- zopeproducts/photo/tests/test_size.py:1.1	Fri Aug 15 08:10:56 2003
+++ zopeproducts/photo/tests/test_size.py	Sun Sep 21 18:17:48 2003
@@ -19,9 +19,10 @@
 import unittest
 
 from zope.app.content.tests.test_image import zptlogo
+from zope.app.services.tests.placefulsetup import PlacefulSetup
 from zopeproducts.photo import Photo, PhotoSized
 
-class TestPhotoSized(unittest.TestCase):
+class TestPhotoSized(PlacefulSetup, unittest.TestCase):
     def test_sizeForSorting(self):
         size = PhotoSized(Photo())
         self.assertEqual(size.sizeForSorting(), ('byte', 0))




More information about the Zope3-Checkins mailing list