[Zope3-checkins] CVS: Zope3/lib/python/Zope/App/OFS/Services/ServiceManager/Views/Browser/tests - testAddServiceDirective.py:1.3

Steve Alexander steve@cat-box.net
Mon, 18 Nov 2002 08:35:43 -0500


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

Modified Files:
	testAddServiceDirective.py 
Log Message:
Added in code to set a valid contentName on the ComponentAdder.


=== Zope3/lib/python/Zope/App/OFS/Services/ServiceManager/Views/Browser/tests/testAddServiceDirective.py 1.2 => 1.3 ===
--- Zope3/lib/python/Zope/App/OFS/Services/ServiceManager/Views/Browser/tests/testAddServiceDirective.py:1.2	Wed Jul 17 12:54:18 2002
+++ Zope3/lib/python/Zope/App/OFS/Services/ServiceManager/Views/Browser/tests/testAddServiceDirective.py	Mon Nov 18 08:35:43 2002
@@ -18,7 +18,7 @@
 $Id$
 """
 
-from unittest import TestCase, TestSuite, main, makeSuite
+from unittest import TestCase, main, makeSuite
 from Zope.App.OFS.Services.ServiceManager.tests.PlacefulSetup \
      import PlacefulSetup
 from Zope.ComponentArchitecture.GlobalServiceManager \
@@ -151,11 +151,12 @@
         service = C()
         packages['default'].setObject('cd1', service)
 
-        view = AddServiceDirective(
-            ComponentAdding(ContextWrapper(packages['default'], packages,
-                                           name='default'),
-                            request),
-            request)
+        component_adding = ComponentAdding(
+                ContextWrapper(packages['default'], packages, name='default'),
+                request)
+        # simulate the important side-effect of traversing component_adding
+        component_adding.contentName = 'new_name'
+        view = AddServiceDirective(component_adding, request)
 
         view.action('s1',
                     '/folder1/folder1_1/++etc++Services/Packages/default/cd1',
@@ -170,11 +171,12 @@
         service = C()
         packages['default'].setObject('cd1', service)
 
-        view = AddServiceDirective(
-            ComponentAdding(ContextWrapper(packages['default'], packages,
-                                           name='default'),
-                            request),
-            request)
+        component_adding = ComponentAdding(
+                ContextWrapper(packages['default'], packages, name='default'),
+                request)
+        # simulate the important side-effect of traversing component_adding
+        component_adding.contentName = 'new_name'
+        view = AddServiceDirective(component_adding, request)
 
         view.action('s1',
                     '/folder1/folder1_1/++etc++Services/Packages/default/cd1',
@@ -188,11 +190,12 @@
         service = C()
         packages['default'].setObject('cd1', service)
 
-        view = AddServiceDirective(
-            ComponentAdding(ContextWrapper(packages['default'], packages,
-                                           name='default'),
-                            request),
-            request)
+        component_adding = ComponentAdding(
+                ContextWrapper(packages['default'], packages, name='default'),
+                request)
+        # simulate the important side-effect of traversing component_adding
+        component_adding.contentName = 'new_name'
+        view = AddServiceDirective(component_adding, request)
 
         view.action('s1',
                     '/folder1/folder1_1/++etc++Services/Packages/default/cd1',