[Zope3-checkins] CVS: Zope3/lib/python/Zope/App/OFS/Container/Views/Browser/tests - testAdding.py:1.4.4.1 testContents.py:1.6.4.1

Suresh Babu Eddala sbabu@zeomega.com
Mon, 21 Oct 2002 11:58:46 -0400


Update of /cvs-repository/Zope3/lib/python/Zope/App/OFS/Container/Views/Browser/tests
In directory cvs.zope.org:/tmp/cvs-serv11840/lib/python/Zope/App/OFS/Container/Views/Browser/tests

Modified Files:
      Tag: Zope3-Bangalore-TTW-Branch
	testAdding.py testContents.py 
Log Message:
Managing(SetObject, delitem, ...) the object in  context of the container.


=== Zope3/lib/python/Zope/App/OFS/Container/Views/Browser/tests/testAdding.py 1.4 => 1.4.4.1 ===
--- Zope3/lib/python/Zope/App/OFS/Container/Views/Browser/tests/testAdding.py:1.4	Fri Oct  4 15:48:31 2002
+++ Zope3/lib/python/Zope/App/OFS/Container/Views/Browser/tests/testAdding.py	Mon Oct 21 11:58:46 2002
@@ -17,7 +17,7 @@
 """
 
 from unittest import TestCase, TestSuite, main, makeSuite
-
+from Zope.ComponentArchitecture.GlobalAdapterService import provideAdapter
 from Zope.App.OFS.Container.Views.Browser.Adding import Adding
 from Zope.App.OFS.Container.IAdding import IAdding
 from Zope.App.tests.PlacelessSetup import PlacelessSetup
@@ -30,7 +30,16 @@
 from Zope.Event.tests.PlacelessSetup import getEvents
 from Zope.Event.IObjectEvent import IObjectAddedEvent, IObjectModifiedEvent
 
+from Zope.App.OFS.Container.IZopeContainer import IZopeContainer
+from Zope.App.OFS.Container.IContainer import IContainer
+from Zope.App.OFS.Container.ZopeContainerAdapter import ZopeContainerAdapter
+
+
+
 class Container:
+
+    __implements__ = IContainer
+    
     def __init__(self):
         self._data = {}
 
@@ -48,14 +57,17 @@
 
 class Test(PlacelessSetup, TestCase):
 
+    def setUp(self):
+        PlacelessSetup.setUp(self)
+        provideAdapter(IContainer, IZopeContainer, ZopeContainerAdapter)    
+
     def test(self):
         container = Container()
         request = TestRequest()
         adding = Adding(container, request)
         provideView(IAdding, "Thing", IBrowserPresentation, CreationView)
-        
         self.assertEqual(adding.contentName, None)
-        view = adding.publishTraverse(request, 'Thing=foo') 
+        view = adding.publishTraverse(request, 'Thing=foo')
         self.assertEqual(view.action(), 'been there, done that')
         self.assertEqual(adding.contentName, 'foo')
 
@@ -65,7 +77,7 @@
 
         o = Container() # any old instance will do
         result = adding.add(o)
-
+        
         # Make sure the right events were generated:
         self.failUnless(
             getEvents(IObjectAddedEvent,


=== Zope3/lib/python/Zope/App/OFS/Container/Views/Browser/tests/testContents.py 1.6 => 1.6.4.1 ===
--- Zope3/lib/python/Zope/App/OFS/Container/Views/Browser/tests/testContents.py:1.6	Fri Oct  4 15:52:25 2002
+++ Zope3/lib/python/Zope/App/OFS/Container/Views/Browser/tests/testContents.py	Mon Oct 21 11:58:46 2002
@@ -21,10 +21,10 @@
 from Zope.App.tests.PlacelessSetup import PlacelessSetup
 from Zope.ComponentArchitecture.GlobalAdapterService import provideAdapter
 
-from Zope.I18n.IUserPreferredCharsets import IUserPreferredCharsets
+from Zope.App.OFS.Container.IZopeContainer import IZopeContainer
+from Zope.App.OFS.Container.IContainer import IContainer
+from Zope.App.OFS.Container.ZopeContainerAdapter import ZopeContainerAdapter
 
-from Zope.Publisher.HTTP.HTTPRequest import IHTTPRequest
-from Zope.Publisher.HTTP.HTTPCharsets import HTTPCharsets
 from Zope.Event.tests.PlacelessSetup import getEvents
 from Zope.Event.IObjectEvent import IObjectRemovedEvent, IObjectModifiedEvent
 from Interface import Interface
@@ -43,7 +43,7 @@
 
     def setUp(self):
         PlacelessSetup.setUp(self)
-        provideAdapter(IHTTPRequest, IUserPreferredCharsets, HTTPCharsets)
+        provideAdapter(IContainer, IZopeContainer, ZopeContainerAdapter)    
         
 
     def testInfo(self):