[Zope3-checkins] SVN: Zope3/branches/roger-contentprovider/src/zope/contentprovider/ Got initial set of tests working.

Stephan Richter srichter at cosmos.phy.tufts.edu
Sat Oct 8 06:39:49 EDT 2005


Log message for revision 38933:
  Got initial set of tests working.
  

Changed:
  U   Zope3/branches/roger-contentprovider/src/zope/contentprovider/README.txt
  U   Zope3/branches/roger-contentprovider/src/zope/contentprovider/tales.py
  U   Zope3/branches/roger-contentprovider/src/zope/contentprovider/tests.py

-=-
Modified: Zope3/branches/roger-contentprovider/src/zope/contentprovider/README.txt
===================================================================
--- Zope3/branches/roger-contentprovider/src/zope/contentprovider/README.txt	2005-10-08 10:33:52 UTC (rev 38932)
+++ Zope3/branches/roger-contentprovider/src/zope/contentprovider/README.txt	2005-10-08 10:39:48 UTC (rev 38933)
@@ -28,9 +28,9 @@
 
   >>> class MessageBox(object):
   ...     zope.interface.implements(interfaces.IContentProvider)
-  ...     zope.component.adapts=(zope.interface.Interface,
-  ...                            browser.IDefaultBrowserLayer,
-  ...                            zope.interface.Interface)
+  ...     zope.component.adapts(zope.interface.Interface,
+  ...                           browser.IDefaultBrowserLayer,
+  ...                           zope.interface.Interface)
   ...     message = u'My Message'
   ...
   ...     def __init__(self, context, request, view):
@@ -83,7 +83,7 @@
   ...   <body>
   ...     <h1>My Web Page</h1>
   ...     <div class="left-column">
-  ...       <tal:block replace="structure provider:mypage.MessageBox">
+  ...       <tal:block replace="structure provider:mypage.MessageBox" />
   ...     </div>
   ...     <div class="main">
   ...       Content here
@@ -102,7 +102,7 @@
 
   >>> zope.component.provideAdapter(
   ...     FrontPage,
-  ...     (zope.interface.Interface, IDefaultBrowserLayer),
+  ...     (zope.interface.Interface, browser.IDefaultBrowserLayer),
   ...     zope.interface.Interface,
   ...     name='main.html')
 
@@ -125,9 +125,7 @@
     <body>
       <h1>My Web Page</h1>
       <div class="left-column">
-        <div class="column-item">
-          <div class="box">My Message</div>
-        </div>
+        <div class="box">My Message</div>
       </div>
       <div class="main">
         Content here

Modified: Zope3/branches/roger-contentprovider/src/zope/contentprovider/tales.py
===================================================================
--- Zope3/branches/roger-contentprovider/src/zope/contentprovider/tales.py	2005-10-08 10:33:52 UTC (rev 38932)
+++ Zope3/branches/roger-contentprovider/src/zope/contentprovider/tales.py	2005-10-08 10:39:48 UTC (rev 38933)
@@ -50,7 +50,7 @@
 
         # Try to look up the provider.
         provider = zope.component.queryMultiAdapter(
-            (context, request, view), interfaces.IContentProviderManager, name)
+            (context, request, view), interfaces.IContentProvider, name)
 
         # Provide a useful error message, if the provider was not found.
         if provider is None:
@@ -59,4 +59,4 @@
         # Insert the data gotten from the context
         addTALNamespaceData(provider, econtext)
 
-        return provider
+        return provider()

Modified: Zope3/branches/roger-contentprovider/src/zope/contentprovider/tests.py
===================================================================
--- Zope3/branches/roger-contentprovider/src/zope/contentprovider/tests.py	2005-10-08 10:33:52 UTC (rev 38932)
+++ Zope3/branches/roger-contentprovider/src/zope/contentprovider/tests.py	2005-10-08 10:39:48 UTC (rev 38933)
@@ -37,7 +37,6 @@
 
     from zope.app.pagetemplate import metaconfigure
     from zope.contentprovider import tales
-    metaconfigure.registerType('providers', tales.TALESProvidersExpression)
     metaconfigure.registerType('provider', tales.TALESProviderExpression)
 
     zope.security.management.getInteraction().add(TestParticipation())
@@ -49,7 +48,7 @@
 
 def test_suite():
     return unittest.TestSuite((
-        DocFileSuite('../README.txt',
+        DocFileSuite('README.txt',
                      setUp=setUp, tearDown=tearDown,
                      optionflags=doctest.NORMALIZE_WHITESPACE|doctest.ELLIPSIS,
                      ),



More information about the Zope3-Checkins mailing list