[Zope3-checkins] CVS: Zope3/src/zope/app/browser/services/tests - test_editconfiguration.py:1.4
Guido van Rossum
guido@python.org
Mon, 10 Mar 2003 17:46:34 -0500
Update of /cvs-repository/Zope3/src/zope/app/browser/services/tests
In directory cvs.zope.org:/tmp/cvs-serv18216/tests
Modified Files:
test_editconfiguration.py
Log Message:
Restructure the default configuration manager view.
This now has two lines per configuration object. Line one is the
"usage summary", typically showing the kind of configuration and the
key. Line two is the "implementation summary", showing some of the
additionally configured information. What exactly is shown is up to
the configuration object.
Adding the methods to come up with the summary lines to the
configuration object rather than making them views is perhaps a little
odd, but Jim decided that it was better than invoking the complicated
machinery needed to define views to return this information.
The "ItemEdit" views are gone, as are some associated templates.
I renamed some of the views to index.html, because we seem to like
that as the default view nowadays.
=== Zope3/src/zope/app/browser/services/tests/test_editconfiguration.py 1.3 => 1.4 ===
--- Zope3/src/zope/app/browser/services/tests/test_editconfiguration.py:1.3 Mon Mar 10 17:09:46 2003
+++ Zope3/src/zope/app/browser/services/tests/test_editconfiguration.py Mon Mar 10 17:46:32 2003
@@ -23,7 +23,7 @@
from zope.interface import Interface
from zope.app.browser.services.service import EditConfiguration
from zope.publisher.browser import TestRequest
-from zope.app.tests.placelesssetup import PlacelessSetup
+from zope.app.services.tests.placefulsetup import PlacefulSetup
from zope.publisher.interfaces.browser import IBrowserPresentation
from zope.component.view import provideView
from zope.component.adapter import provideAdapter
@@ -34,18 +34,22 @@
from zope.app.interfaces.container import IContainer
from zope.app.interfaces.container import IZopeContainer
from zope.app.container.zopecontainer import ZopeContainerAdapter
+from zope.app.interfaces.traversing import IContainmentRoot
+from zope.app.interfaces.services.configuration \
+ import Unregistered, Registered, Active
class Container(dict):
- __implements__ = IContainer
+ __implements__ = IContainer, IContainmentRoot
class I(Interface):
pass
class C:
__implements__ = I
+ status = Active
-class Test(PlacelessSetup, TestCase):
+class Test(PlacefulSetup, TestCase):
def test_remove_objects(self):
@@ -90,18 +94,9 @@
info = view.configInfo()
self.assertEqual(len(info), 3)
- self.assertEqual(info[0]['key'], '1')
- self.assertEqual(info[1]['key'], '2')
- self.assertEqual(info[2]['key'], '7')
- self.assertEqual(info[0]['view'].__class__, V)
- self.assertEqual(info[0]['view'].context, c1)
- self.assertEqual(info[0]['view']._prefix, 'config1')
- self.assertEqual(info[1]['view'].__class__, V)
- self.assertEqual(info[1]['view'].context, c2)
- self.assertEqual(info[1]['view']._prefix, 'config2')
- self.assertEqual(info[2]['view'].__class__, V)
- self.assertEqual(info[2]['view'].context, c7)
- self.assertEqual(info[2]['view']._prefix, 'config7')
+ self.assertEqual(info[0]['name'], '1')
+ self.assertEqual(info[1]['name'], '2')
+ self.assertEqual(info[2]['name'], '7')
def test_suite():
return TestSuite((