[Checkins] SVN: five.grok/branches/sylvain-zope213/ Cleanup code for Zope 2.13. Update funky test setup.

Sylvain Viollon sylvain at infrae.com
Mon Nov 1 16:41:35 EDT 2010


Log message for revision 118118:
  Cleanup code for Zope 2.13. Update funky test setup.
  
  

Changed:
  U   five.grok/branches/sylvain-zope213/buildout.cfg
  U   five.grok/branches/sylvain-zope213/setup.py
  U   five.grok/branches/sylvain-zope213/src/five/grok/README.txt
  U   five.grok/branches/sylvain-zope213/src/five/grok/__init__.py
  U   five.grok/branches/sylvain-zope213/src/five/grok/components.py
  U   five.grok/branches/sylvain-zope213/src/five/grok/configure.zcml
  U   five.grok/branches/sylvain-zope213/src/five/grok/ftesting.zcml
  U   five.grok/branches/sylvain-zope213/src/five/grok/ftests/directoryresource/dirresource.py
  U   five.grok/branches/sylvain-zope213/src/five/grok/ftests/form/autofields.py
  U   five.grok/branches/sylvain-zope213/src/five/grok/ftests/form/autofields2.py
  U   five.grok/branches/sylvain-zope213/src/five/grok/ftests/form/form.py
  U   five.grok/branches/sylvain-zope213/src/five/grok/ftests/test_grok_functional.py
  U   five.grok/branches/sylvain-zope213/src/five/grok/ftests/view/argument.py
  U   five.grok/branches/sylvain-zope213/src/five/grok/ftests/view/association.py
  U   five.grok/branches/sylvain-zope213/src/five/grok/ftests/view/file.py
  U   five.grok/branches/sylvain-zope213/src/five/grok/ftests/view/index.py
  U   five.grok/branches/sylvain-zope213/src/five/grok/ftests/view/layers.py
  U   five.grok/branches/sylvain-zope213/src/five/grok/ftests/view/macros.py
  U   five.grok/branches/sylvain-zope213/src/five/grok/ftests/view/namespace.py
  U   five.grok/branches/sylvain-zope213/src/five/grok/ftests/view/namespace_override.py
  U   five.grok/branches/sylvain-zope213/src/five/grok/ftests/view/resource.py
  U   five.grok/branches/sylvain-zope213/src/five/grok/ftests/view/view.py
  U   five.grok/branches/sylvain-zope213/src/five/grok/ftests/viewlet/manager_render.py
  U   five.grok/branches/sylvain-zope213/src/five/grok/ftests/viewlet/manager_template.py
  U   five.grok/branches/sylvain-zope213/src/five/grok/ftests/viewlet/security.py
  U   five.grok/branches/sylvain-zope213/src/five/grok/ftests/viewlet/simple.py
  U   five.grok/branches/sylvain-zope213/src/five/grok/ftests/viewlet/simple2.py
  U   five.grok/branches/sylvain-zope213/src/five/grok/meta.py
  U   five.grok/branches/sylvain-zope213/src/five/grok/subscribers.py
  U   five.grok/branches/sylvain-zope213/src/five/grok/testing.py
  U   five.grok/branches/sylvain-zope213/src/five/grok/tests/adapters.py
  U   five.grok/branches/sylvain-zope213/src/five/grok/tests/annotation.py
  D   five.grok/branches/sylvain-zope213/src/five/grok/tests/doctest.py
  U   five.grok/branches/sylvain-zope213/src/five/grok/tests/multiadapter.py
  U   five.grok/branches/sylvain-zope213/src/five/grok/tests/resource.py
  U   five.grok/branches/sylvain-zope213/src/five/grok/tests/subscribers.py
  U   five.grok/branches/sylvain-zope213/src/five/grok/tests/test_all.py
  U   five.grok/branches/sylvain-zope213/src/five/grok/tests/utilities.py

-=-
Modified: five.grok/branches/sylvain-zope213/buildout.cfg
===================================================================
--- five.grok/branches/sylvain-zope213/buildout.cfg	2010-11-01 20:37:57 UTC (rev 118117)
+++ five.grok/branches/sylvain-zope213/buildout.cfg	2010-11-01 20:41:34 UTC (rev 118118)
@@ -3,29 +3,34 @@
     zope2
     instance
     test
+    code
 extensions = buildout.dumppickedversions
 develop = .
-extends = http://download.zope.org/Zope2/index/2.12.7/versions.cfg
+extends = http://download.zope.org/Zope2/index/2.13.0c1/versions.cfg
 versions = versions
 
 [versions]
-plone.recipe.zope2instance = 3.6
+plone.recipe.zope2instance =
 grokcore.annotation = 1.2
-grokcore.component = 1.8
+grokcore.component = 1.9
 grokcore.formlib = 1.5
 grokcore.security = 1.4
-grokcore.site = 1.2
-grokcore.view = 1.12.2
-grokcore.viewlet = 1.4.1
-five.localsitemanager = 2.0.3
+grokcore.site = 1.3
+grokcore.view = 1.13.5
+grokcore.viewlet = 1.5
+five.localsitemanager = 2.0.4
 martian = 0.11.2
-Zope2 = 2.12.7
+Zope2 = 2.13.0c1
 
 # This is needed in order to set up the mkzopeinstance script
 [zope2]
 recipe = zc.recipe.egg
 eggs = Zope2
 
+[code]
+recipe = collective.recipe.omelette
+eggs = ${instance:eggs}
+
 [instance]
 recipe = plone.recipe.zope2instance
 user = admin:admin

Modified: five.grok/branches/sylvain-zope213/setup.py
===================================================================
--- five.grok/branches/sylvain-zope213/setup.py	2010-11-01 20:37:57 UTC (rev 118117)
+++ five.grok/branches/sylvain-zope213/setup.py	2010-11-01 20:41:34 UTC (rev 118118)
@@ -30,6 +30,7 @@
         'setuptools',
         'martian',
         'Zope2',
+        'five.formlib',
         'five.localsitemanager > 2.0dev',
         'grokcore.component',
         'grokcore.formlib >= 1.4',

Modified: five.grok/branches/sylvain-zope213/src/five/grok/README.txt
===================================================================
--- five.grok/branches/sylvain-zope213/src/five/grok/README.txt	2010-11-01 20:37:57 UTC (rev 118117)
+++ five.grok/branches/sylvain-zope213/src/five/grok/README.txt	2010-11-01 20:41:34 UTC (rev 118118)
@@ -37,10 +37,7 @@
 
     >>> from zope.component import getUtility
     >>> from five.grok.README import *
-    >>> from Testing.ZopeTestCase import ZopeLite as Zope2
-    >>> from Testing.makerequest import makerequest
-    >>> app = Zope2.app()
-    >>> app = makerequest(app)
+    >>> app = getRootFolder()
     >>> request = app.REQUEST
 
     >>> village = GrokVillage(id='amsterdam')
@@ -199,7 +196,7 @@
 We can create a local utility. When a ``CaveWoman`` is added, we can
 lookup our utility and use it::
 
-    <<< from zope.app.container.interfaces import IObjectAddedEvent
+    <<< from zope.container.interfaces import IObjectAddedEvent
     <<< from zope.component import getUtility
 
     <<< class ICaveInformations(Interface):

Modified: five.grok/branches/sylvain-zope213/src/five/grok/__init__.py
===================================================================
--- five.grok/branches/sylvain-zope213/src/five/grok/__init__.py	2010-11-01 20:37:57 UTC (rev 118117)
+++ five.grok/branches/sylvain-zope213/src/five/grok/__init__.py	2010-11-01 20:41:34 UTC (rev 118118)
@@ -26,9 +26,6 @@
 from five.grok.components import View, ViewletManager
 from five.grok.formlib import AutoFields
 
-# backwards compatibility. Probably not needed by many, but just in case.
-# please start using grokcore.view.View again.
-CodeView = View
 
 # Override the one from grokcore.view so that we get Zope 2 semantics
 from five.grok.components import ZopeTwoPageTemplate as PageTemplate

Modified: five.grok/branches/sylvain-zope213/src/five/grok/components.py
===================================================================
--- five.grok/branches/sylvain-zope213/src/five/grok/components.py	2010-11-01 20:37:57 UTC (rev 118117)
+++ five.grok/branches/sylvain-zope213/src/five/grok/components.py	2010-11-01 20:41:34 UTC (rev 118118)
@@ -13,31 +13,29 @@
 ##############################################################################
 
 import martian
-import martian.util
 
 import os.path
 import sys
 
 from zope.annotation.interfaces import IAttributeAnnotatable
-from zope.app.pagetemplate.viewpagetemplatefile import ViewMapper
 from zope.location.interfaces import IPossibleSite
-from zope import interface, component
+from zope import interface
 
 from grokcore.component.interfaces import IContext
 from grokcore.formlib.components import GrokForm as BaseGrokForm
 from grokcore.formlib.components import default_display_template, \
     default_form_template
 from grokcore.view.components import PageTemplate
-from grokcore.viewlet.components import Viewlet as BaseViewlet
 from grokcore.viewlet.components import ViewletManager as BaseViewletManager
 from grokcore.site.components import BaseSite
 import grokcore.view
 import grokcore.security
+from five.formlib import formbase
 
+from Products.Five.browser.pagetemplatefile import ViewMapper
 from Products.Five.browser.pagetemplatefile import ViewPageTemplateFile
 from Products.Five.browser.pagetemplatefile import getEngine
 from Products.Five.browser import resource
-from Products.Five.formlib import formbase
 from Products.Five.viewlet.manager import ViewletManagerBase as \
     ZopeTwoBaseViewletManager
 from zope.pagetemplate.pagetemplate import PageTemplate as ZopePageTemplate
@@ -46,7 +44,6 @@
 from OFS.SimpleItem import SimpleItem
 from OFS.Folder import Folder
 
-import Acquisition
 from AccessControl import getSecurityManager
 from Acquisition import aq_get
 
@@ -150,12 +147,13 @@
 
     # Allow traversal to contained resources from protected code
     __allow_access_to_unprotected_subobjects__ = True
-    
+
     # Allow subdirectories to work with restrictedTraverse() (in Zope >= 2.12.6)
     __roles__ = None
-    
+
     resource_factories = {}
-    for type, factory in (resource.DirectoryResource.resource_factories.items()):
+    for type, factory in (
+        resource.DirectoryResource.resource_factories.items()):
         if factory is resource.PageTemplateResourceFactory:
             continue
         resource_factories[type] = factory
@@ -164,7 +162,7 @@
 class ZopeTwoDirectoryResourceFactory(resource.DirectoryResourceFactory):
     # __name__ is needed if you want to get url's of resources
 
-    def __init__(self, name, path):
+    def __init__(self, name, path, resource_factory=None):
         self.__name = name
         self.__rsrc = self.factory(path, name)
 
@@ -184,19 +182,16 @@
 
 
 class Form(GrokForm, formbase.PageForm, View):
-
     martian.baseclass()
     template = default_form_template
 
 
 class AddForm(GrokForm, formbase.AddForm, View):
-
     martian.baseclass()
     template = default_form_template
 
 
 class EditForm(GrokForm, formbase.EditForm, View):
-
     martian.baseclass()
     template = default_form_template
 
@@ -206,7 +201,6 @@
 
 
 class DisplayForm(GrokForm, formbase.DisplayForm, View):
-
     martian.baseclass()
     template = default_display_template
 

Modified: five.grok/branches/sylvain-zope213/src/five/grok/configure.zcml
===================================================================
--- five.grok/branches/sylvain-zope213/src/five/grok/configure.zcml	2010-11-01 20:37:57 UTC (rev 118117)
+++ five.grok/branches/sylvain-zope213/src/five/grok/configure.zcml	2010-11-01 20:41:34 UTC (rev 118118)
@@ -6,13 +6,14 @@
     i18n_domain="five.grok">
 
   <include package="Products.Five" />
-
   <include package="five.grok" file="meta.zcml" />
 
+  <include package="five.formlib" />
   <include package="five.localsitemanager" />
   <include package="grokcore.annotation" />
   <include package="grokcore.view" />
-  <include package="grokcore.viewlet" />
+  <!-- zope.contentprovider doesn't work by default -->
+  <!--   <include package="grokcore.viewlet" /> -->
 
   <grok:grok package=".subscribers" />
   <grok:grok package=".absoluteurl" />
@@ -20,16 +21,10 @@
   <utility component="grokcore.site.meta.setupUtility" />
 
   <browser:defaultView
-      for="grokcore.component.interfaces.IContext"
-      name="index"
-      />
+     for="grokcore.component.interfaces.IContext"
+     name="index"
+     />
 
-  <permission
-      id="zope.View"
-      title="View"
-      zcml:condition="not-installed kss.core"
-      />
-
   <includeOverrides file="overrides.zcml" />
 
 </configure>

Modified: five.grok/branches/sylvain-zope213/src/five/grok/ftesting.zcml
===================================================================
--- five.grok/branches/sylvain-zope213/src/five/grok/ftesting.zcml	2010-11-01 20:37:57 UTC (rev 118117)
+++ five.grok/branches/sylvain-zope213/src/five/grok/ftesting.zcml	2010-11-01 20:41:34 UTC (rev 118118)
@@ -6,6 +6,5 @@
 
   <!-- And also grok all the ftests /-->
   <grok:grok package="five.grok.ftests" />
-  <include package="zope.app.rotterdam" />
 
 </configure>

Modified: five.grok/branches/sylvain-zope213/src/five/grok/ftests/directoryresource/dirresource.py
===================================================================
--- five.grok/branches/sylvain-zope213/src/five/grok/ftests/directoryresource/dirresource.py	2010-11-01 20:37:57 UTC (rev 118117)
+++ five.grok/branches/sylvain-zope213/src/five/grok/ftests/directoryresource/dirresource.py	2010-11-01 20:41:34 UTC (rev 118118)
@@ -3,7 +3,7 @@
 through the dotted name of the module in which the directoryresource is
 defined::
 
-  >>> from Products.Five.testbrowser import Browser
+  >>> from Testing.testbrowser import Browser
   >>> browser = Browser()
   >>> browser.handleErrors = False
   >>> browser.open(

Modified: five.grok/branches/sylvain-zope213/src/five/grok/ftests/form/autofields.py
===================================================================
--- five.grok/branches/sylvain-zope213/src/five/grok/ftests/form/autofields.py	2010-11-01 20:37:57 UTC (rev 118117)
+++ five.grok/branches/sylvain-zope213/src/five/grok/ftests/form/autofields.py	2010-11-01 20:41:34 UTC (rev 118118)
@@ -2,7 +2,7 @@
   >>> from five.grok.ftests.form.autofields import *
   >>> id = getRootFolder()._setObject("manfred", Mammoth(id='manfred'))
 
-  >>> from Products.Five.testbrowser import Browser
+  >>> from Testing.testbrowser import Browser
   >>> browser = Browser()
   >>> browser.handleErrors = False
 

Modified: five.grok/branches/sylvain-zope213/src/five/grok/ftests/form/autofields2.py
===================================================================
--- five.grok/branches/sylvain-zope213/src/five/grok/ftests/form/autofields2.py	2010-11-01 20:37:57 UTC (rev 118117)
+++ five.grok/branches/sylvain-zope213/src/five/grok/ftests/form/autofields2.py	2010-11-01 20:41:34 UTC (rev 118118)
@@ -2,7 +2,7 @@
   >>> from five.grok.ftests.form.autofields2 import *
   >>> id = getRootFolder()._setObject("montparnasse", House(id='montparnasse'))
 
-  >>> from Products.Five.testbrowser import Browser
+  >>> from Testing.testbrowser import Browser
   >>> browser = Browser()
   >>> browser.handleErrors = False
 

Modified: five.grok/branches/sylvain-zope213/src/five/grok/ftests/form/form.py
===================================================================
--- five.grok/branches/sylvain-zope213/src/five/grok/ftests/form/form.py	2010-11-01 20:37:57 UTC (rev 118117)
+++ five.grok/branches/sylvain-zope213/src/five/grok/ftests/form/form.py	2010-11-01 20:41:34 UTC (rev 118118)
@@ -2,7 +2,7 @@
   >>> from five.grok.ftests.form.form import *
   >>> id = getRootFolder()._setObject("manfred", Mammoth(id='manfred'))
 
-  >>> from Products.Five.testbrowser import Browser
+  >>> from Testing.testbrowser import Browser
   >>> browser = Browser()
   >>> browser.handleErrors = False
 

Modified: five.grok/branches/sylvain-zope213/src/five/grok/ftests/test_grok_functional.py
===================================================================
--- five.grok/branches/sylvain-zope213/src/five/grok/ftests/test_grok_functional.py	2010-11-01 20:37:57 UTC (rev 118117)
+++ five.grok/branches/sylvain-zope213/src/five/grok/ftests/test_grok_functional.py	2010-11-01 20:41:34 UTC (rev 118118)
@@ -1,37 +1,29 @@
+##############################################################################
+#
+# Copyright (c) 2007 Zope Foundation and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+
 import unittest
+import doctest
 
-from pkg_resources import resource_listdir
-from zope.testing import doctest
-from zope.app.testing.functional import HTTPCaller
-from five.grok.testing import GrokFunctionalLayer
-from Testing.ZopeTestCase.zopedoctest.functional import getRootFolder, sync
 from Testing.ZopeTestCase import FunctionalDocTestSuite
-
 from Testing.ZopeTestCase import installProduct
+from Testing.ZopeTestCase.zopedoctest.functional import getRootFolder, sync
+from five.grok.testing import FunctionalLayer
+from pkg_resources import resource_listdir
+
 installProduct('PageTemplates')
 
-import Zope2 ; Zope2.startup()
 
-def http_call(method, path, data=None, **kw):
-    """Function to help make RESTful calls.
-
-    method - HTTP method to use
-    path - testbrowser style path
-    data - (body) data to submit
-    kw - any request parameters
-    """
-
-    if path.startswith('http://localhost'):
-        path = path[len('http://localhost'):]
-    request_string = '%s %s HTTP/1.1\n' % (method, path)
-    for key, value in kw.items():
-        request_string += '%s: %s\n' % (key, value)
-    if data is not None:
-        request_string += '\r\n'
-        request_string += data
-    return HTTPCaller()(request_string, handle_errors=False)
-
-
 def suiteFromPackage(name):
     files = resource_listdir(__name__, name)
     suite = unittest.TestSuite()
@@ -48,14 +40,12 @@
         dottedname = 'five.grok.ftests.%s.%s' % (name, filename[:-3])
         test = FunctionalDocTestSuite(
             dottedname,
-            extraglobs=dict(http=HTTPCaller(),
-                            http_call=http_call,
-                            getRootFolder=getRootFolder,
+            extraglobs=dict(getRootFolder=getRootFolder,
                             sync=sync),
             optionflags=(doctest.ELLIPSIS+
                          doctest.NORMALIZE_WHITESPACE+
                          doctest.REPORT_NDIFF))
-        test.layer = GrokFunctionalLayer
+        test.layer = FunctionalLayer
 
         suite.addTest(test)
     return suite
@@ -66,6 +56,3 @@
     for name in ['directoryresource', 'view', 'viewlet','form', 'site']:
         suite.addTest(suiteFromPackage(name))
     return suite
-
-if __name__ == '__main__':
-    unittest.main(defaultTest='test_suite')

Modified: five.grok/branches/sylvain-zope213/src/five/grok/ftests/view/argument.py
===================================================================
--- five.grok/branches/sylvain-zope213/src/five/grok/ftests/view/argument.py	2010-11-01 20:37:57 UTC (rev 118117)
+++ five.grok/branches/sylvain-zope213/src/five/grok/ftests/view/argument.py	2010-11-01 20:41:34 UTC (rev 118118)
@@ -3,7 +3,7 @@
   >>> from five.grok.ftests.view.argument import *
   >>> id = getRootFolder()._setObject("manfred", Mammoth(id='manfred'))
 
-  >>> from Products.Five.testbrowser import Browser
+  >>> from Testing.testbrowser import Browser
   >>> browser = Browser()
   >>> browser.handleErrors = False
 

Modified: five.grok/branches/sylvain-zope213/src/five/grok/ftests/view/association.py
===================================================================
--- five.grok/branches/sylvain-zope213/src/five/grok/ftests/view/association.py	2010-11-01 20:37:57 UTC (rev 118117)
+++ five.grok/branches/sylvain-zope213/src/five/grok/ftests/view/association.py	2010-11-01 20:41:34 UTC (rev 118118)
@@ -2,7 +2,7 @@
   >>> from five.grok.ftests.view.association import *
   >>> id = getRootFolder()._setObject("manfred", Mammoth(id='manfred'))
 
-  >>> from Products.Five.testbrowser import Browser
+  >>> from Testing.testbrowser import Browser
   >>> browser = Browser()
   >>> browser.handleErrors = False
   >>> browser.open("http://localhost/manfred/@@art")

Modified: five.grok/branches/sylvain-zope213/src/five/grok/ftests/view/file.py
===================================================================
--- five.grok/branches/sylvain-zope213/src/five/grok/ftests/view/file.py	2010-11-01 20:37:57 UTC (rev 118117)
+++ five.grok/branches/sylvain-zope213/src/five/grok/ftests/view/file.py	2010-11-01 20:41:34 UTC (rev 118118)
@@ -2,7 +2,7 @@
   >>> from five.grok.ftests.view.file import *
   >>> id = getRootFolder()._setObject("manfred", Mammoth(id='manfred'))
 
-  >>> from Products.Five.testbrowser import Browser
+  >>> from Testing.testbrowser import Browser
   >>> browser = Browser()
   >>> browser.handleErrors = False
   >>> browser.open("http://localhost/manfred/@@painting")

Modified: five.grok/branches/sylvain-zope213/src/five/grok/ftests/view/index.py
===================================================================
--- five.grok/branches/sylvain-zope213/src/five/grok/ftests/view/index.py	2010-11-01 20:37:57 UTC (rev 118117)
+++ five.grok/branches/sylvain-zope213/src/five/grok/ftests/view/index.py	2010-11-01 20:41:34 UTC (rev 118118)
@@ -6,7 +6,7 @@
 
 The default view name for a model is 'index':
 
-  >>> from Products.Five.testbrowser import Browser
+  >>> from Testing.testbrowser import Browser
   >>> browser = Browser()
   >>> browser.handleErrors = False
   >>> browser.open("http://localhost/manfred")

Modified: five.grok/branches/sylvain-zope213/src/five/grok/ftests/view/layers.py
===================================================================
--- five.grok/branches/sylvain-zope213/src/five/grok/ftests/view/layers.py	2010-11-01 20:37:57 UTC (rev 118117)
+++ five.grok/branches/sylvain-zope213/src/five/grok/ftests/view/layers.py	2010-11-01 20:41:34 UTC (rev 118118)
@@ -2,7 +2,7 @@
   >>> from five.grok.ftests.view.layers import *
   >>> id = getRootFolder()._setObject("manfred", Mammoth(id='manfred'))
 
-  >>> from Products.Five.testbrowser import Browser
+  >>> from Testing.testbrowser import Browser
   >>> browser = Browser()
   >>> browser.handleErrors = False
   >>> browser.open("http://localhost/manfred/@@cavedrawings")
@@ -23,13 +23,16 @@
 
 """
 from five import grok
-from zope.app.rotterdam import rotterdam
 
 
 class MySkinLayer(grok.IBrowserRequest):
     grok.skin('myskin')
 
 
+class MyRotterdamLayer(MySkinLayer):
+    grok.skin('Rotterdam')
+
+
 class Mammoth(grok.Model):
     pass
 
@@ -48,7 +51,7 @@
 
 
 class MoreDrawings(grok.View):
-    grok.layer(rotterdam)
+    grok.layer(MyRotterdamLayer)
 
     def render(self):
         return "Pretty"

Modified: five.grok/branches/sylvain-zope213/src/five/grok/ftests/view/macros.py
===================================================================
--- five.grok/branches/sylvain-zope213/src/five/grok/ftests/view/macros.py	2010-11-01 20:37:57 UTC (rev 118117)
+++ five.grok/branches/sylvain-zope213/src/five/grok/ftests/view/macros.py	2010-11-01 20:41:34 UTC (rev 118118)
@@ -2,7 +2,7 @@
   >>> from five.grok.ftests.view.macros import *
   >>> id = getRootFolder()._setObject("manfred", Mammoth(id='manfred'))
 
-  >>> from Products.Five.testbrowser import Browser
+  >>> from Testing.testbrowser import Browser
   >>> browser = Browser()
   >>> browser.handleErrors = False
   >>> browser.open("http://localhost/manfred/@@painting")

Modified: five.grok/branches/sylvain-zope213/src/five/grok/ftests/view/namespace.py
===================================================================
--- five.grok/branches/sylvain-zope213/src/five/grok/ftests/view/namespace.py	2010-11-01 20:37:57 UTC (rev 118117)
+++ five.grok/branches/sylvain-zope213/src/five/grok/ftests/view/namespace.py	2010-11-01 20:41:34 UTC (rev 118118)
@@ -2,7 +2,7 @@
   >>> from five.grok.ftests.view.namespace import *
   >>> id = getRootFolder()._setObject("manfred", Mammoth(id='manfred'))
 
-  >>> from Products.Five.testbrowser import Browser
+  >>> from Testing.testbrowser import Browser
   >>> browser = Browser()
   >>> browser.handleErrors = False
   >>> browser.open("http://localhost/manfred")

Modified: five.grok/branches/sylvain-zope213/src/five/grok/ftests/view/namespace_override.py
===================================================================
--- five.grok/branches/sylvain-zope213/src/five/grok/ftests/view/namespace_override.py	2010-11-01 20:37:57 UTC (rev 118117)
+++ five.grok/branches/sylvain-zope213/src/five/grok/ftests/view/namespace_override.py	2010-11-01 20:41:34 UTC (rev 118118)
@@ -2,7 +2,7 @@
   >>> from five.grok.ftests.view.namespace_override import *
   >>> id = getRootFolder()._setObject("manfred", Mammoth(id='manfred'))
 
-  >>> from Products.Five.testbrowser import Browser
+  >>> from Testing.testbrowser import Browser
   >>> browser = Browser()
   >>> browser.handleErrors = False
   >>> browser.open("http://localhost/manfred")

Modified: five.grok/branches/sylvain-zope213/src/five/grok/ftests/view/resource.py
===================================================================
--- five.grok/branches/sylvain-zope213/src/five/grok/ftests/view/resource.py	2010-11-01 20:37:57 UTC (rev 118117)
+++ five.grok/branches/sylvain-zope213/src/five/grok/ftests/view/resource.py	2010-11-01 20:41:34 UTC (rev 118118)
@@ -1,7 +1,7 @@
 """
   >>> from five.grok.ftests.view.resource import *
 
-  >>> from Products.Five.testbrowser import Browser
+  >>> from Testing.testbrowser import Browser
   >>> browser = Browser()
   >>> browser.handleErrors = False
 
@@ -21,7 +21,7 @@
   >>> print browser.contents
   <tal:test>This template should be considered as a file.</tal:test>
   >>> print browser.headers['content-type']
-  text/html; charset=iso-8859-15
+  text/plain; charset=iso-8859-15
 
   Set a content, and ask the view on it. In a view, you should be able
   to get the resource URL:
@@ -32,7 +32,7 @@
   <html>
   <body>
   <h1>Hello I a mammoth!</h1>
-  <a href="http://localhost/manfred/++resource++five.grok.ftests.view/style.css">A link to some style for life!</a>
+  <a href="http://localhost/manfred//++resource++five.grok.ftests.view/style.css">A link to some style for life!</a>
   </body>
   </html>
 

Modified: five.grok/branches/sylvain-zope213/src/five/grok/ftests/view/view.py
===================================================================
--- five.grok/branches/sylvain-zope213/src/five/grok/ftests/view/view.py	2010-11-01 20:37:57 UTC (rev 118117)
+++ five.grok/branches/sylvain-zope213/src/five/grok/ftests/view/view.py	2010-11-01 20:41:34 UTC (rev 118118)
@@ -2,7 +2,7 @@
   >>> from five.grok.ftests.view.view import *
   >>> id = getRootFolder()._setObject("manfred", Mammoth(id='manfred'))
 
-  >>> from Products.Five.testbrowser import Browser
+  >>> from Testing.testbrowser import Browser
   >>> browser = Browser()
   >>> browser.handleErrors = False
   >>> browser.open("http://localhost/manfred/@@painting")

Modified: five.grok/branches/sylvain-zope213/src/five/grok/ftests/viewlet/manager_render.py
===================================================================
--- five.grok/branches/sylvain-zope213/src/five/grok/ftests/viewlet/manager_render.py	2010-11-01 20:37:57 UTC (rev 118117)
+++ five.grok/branches/sylvain-zope213/src/five/grok/ftests/viewlet/manager_render.py	2010-11-01 20:41:34 UTC (rev 118118)
@@ -2,7 +2,7 @@
   >>> from five.grok.ftests.viewlet.manager_render import *
   >>> id = getRootFolder()._setObject("manfred", Mammoth(id='manfred'))
 
-  >>> from Products.Five.testbrowser import Browser
+  >>> from Testing.testbrowser import Browser
   >>> browser = Browser()
   >>> browser.handleErrors = False
   >>> browser.open("http://localhost/manfred/@@painting")

Modified: five.grok/branches/sylvain-zope213/src/five/grok/ftests/viewlet/manager_template.py
===================================================================
--- five.grok/branches/sylvain-zope213/src/five/grok/ftests/viewlet/manager_template.py	2010-11-01 20:37:57 UTC (rev 118117)
+++ five.grok/branches/sylvain-zope213/src/five/grok/ftests/viewlet/manager_template.py	2010-11-01 20:41:34 UTC (rev 118118)
@@ -2,7 +2,7 @@
   >>> from five.grok.ftests.viewlet.manager_template import *
   >>> id = getRootFolder()._setObject("manfred", Mammoth(id='manfred'))
 
-  >>> from Products.Five.testbrowser import Browser
+  >>> from Testing.testbrowser import Browser
   >>> browser = Browser()
   >>> browser.handleErrors = False
   >>> browser.open("http://localhost/manfred/@@painting")

Modified: five.grok/branches/sylvain-zope213/src/five/grok/ftests/viewlet/security.py
===================================================================
--- five.grok/branches/sylvain-zope213/src/five/grok/ftests/viewlet/security.py	2010-11-01 20:37:57 UTC (rev 118117)
+++ five.grok/branches/sylvain-zope213/src/five/grok/ftests/viewlet/security.py	2010-11-01 20:41:34 UTC (rev 118118)
@@ -3,7 +3,7 @@
   >>> root = getRootFolder()
   >>> id = root._setObject("manfred", Mammoth(id='manfred'))
 
-  >>> from Products.Five.testbrowser import Browser
+  >>> from Testing.testbrowser import Browser
   >>> browser = Browser()
   >>> browser.handleErrors = False
   >>> browser.open("http://localhost/manfred/@@painting")

Modified: five.grok/branches/sylvain-zope213/src/five/grok/ftests/viewlet/simple.py
===================================================================
--- five.grok/branches/sylvain-zope213/src/five/grok/ftests/viewlet/simple.py	2010-11-01 20:37:57 UTC (rev 118117)
+++ five.grok/branches/sylvain-zope213/src/five/grok/ftests/viewlet/simple.py	2010-11-01 20:41:34 UTC (rev 118118)
@@ -2,7 +2,7 @@
   >>> from five.grok.ftests.viewlet.simple import *
   >>> id = getRootFolder()._setObject("manfred", Mammoth(id='manfred'))
 
-  >>> from Products.Five.testbrowser import Browser
+  >>> from Testing.testbrowser import Browser
   >>> browser = Browser()
   >>> browser.handleErrors = False
   >>> browser.open("http://localhost/manfred/@@painting")

Modified: five.grok/branches/sylvain-zope213/src/five/grok/ftests/viewlet/simple2.py
===================================================================
--- five.grok/branches/sylvain-zope213/src/five/grok/ftests/viewlet/simple2.py	2010-11-01 20:37:57 UTC (rev 118117)
+++ five.grok/branches/sylvain-zope213/src/five/grok/ftests/viewlet/simple2.py	2010-11-01 20:41:34 UTC (rev 118118)
@@ -2,7 +2,7 @@
   >>> from five.grok.ftests.viewlet.simple2 import *
   >>> id = getRootFolder()._setObject("manfred", Mammoth(id='manfred'))
 
-  >>> from Products.Five.testbrowser import Browser
+  >>> from Testing.testbrowser import Browser
   >>> browser = Browser()
   >>> browser.handleErrors = False
   >>> browser.open("http://localhost/manfred/@@painting")

Modified: five.grok/branches/sylvain-zope213/src/five/grok/meta.py
===================================================================
--- five.grok/branches/sylvain-zope213/src/five/grok/meta.py	2010-11-01 20:37:57 UTC (rev 118117)
+++ five.grok/branches/sylvain-zope213/src/five/grok/meta.py	2010-11-01 20:41:34 UTC (rev 118118)
@@ -12,28 +12,24 @@
 #
 ##############################################################################
 
-import martian
+import os.path
+
+from five.grok import components, formlib
+from grokcore.view.meta.directoryresource import _get_resource_path
+from zope import interface, component
+from zope.publisher.interfaces.browser import IDefaultBrowserLayer
 import five.grok
-import grokcore.security
-import grokcore.view
 import grokcore.component
+import grokcore.security
 import grokcore.site.interfaces
+import grokcore.view
+import martian
 
-from zope import interface, component
-from zope.app.container.interfaces import INameChooser
-from zope.publisher.interfaces.browser import IDefaultBrowserLayer
-from five.grok import components, formlib
-from grokcore.view.meta.directoryresource import _get_resource_path
-from martian.error import GrokError
-
-from Products.Five.security import protectClass, protectName
+from AccessControl.security import protectClass, protectName
 from App.class_init import InitializeClass as initializeClass
 
-import os.path
 
-
 class FormGrokker(martian.ClassGrokker):
-
     martian.component(components.GrokForm)
     martian.directive(grokcore.component.context)
     martian.priority(800)       # Must be run before real formlib grokker.

Modified: five.grok/branches/sylvain-zope213/src/five/grok/subscribers.py
===================================================================
--- five.grok/branches/sylvain-zope213/src/five/grok/subscribers.py	2010-11-01 20:37:57 UTC (rev 118117)
+++ five.grok/branches/sylvain-zope213/src/five/grok/subscribers.py	2010-11-01 20:41:34 UTC (rev 118118)
@@ -13,7 +13,7 @@
 ##############################################################################
 
 import grokcore.component
-from zope.app.container.interfaces import IObjectAddedEvent
+from zope.container.interfaces import IObjectAddedEvent
 from five.localsitemanager import make_objectmanager_site
 
 from five.grok.components import Site

Modified: five.grok/branches/sylvain-zope213/src/five/grok/testing.py
===================================================================
--- five.grok/branches/sylvain-zope213/src/five/grok/testing.py	2010-11-01 20:37:57 UTC (rev 118117)
+++ five.grok/branches/sylvain-zope213/src/five/grok/testing.py	2010-11-01 20:41:34 UTC (rev 118118)
@@ -13,12 +13,14 @@
 ##############################################################################
 """Grok test helpers
 """
-import sys
-import grokcore.component
-from zope.configuration.config import ConfigurationMachine
-from martian import scan
+
+from Testing.ZopeTestCase.layer import ZopeLite
 from grokcore.component import zcml
+from zope.component.testlayer import ZCMLFileLayer
+from zope.configuration.config import ConfigurationMachine
+import five.grok
 
+
 def grok(module_name):
     config = ConfigurationMachine()
     zcml.do_grok('grokcore.component.meta', config)
@@ -32,92 +34,18 @@
     zcml.do_grok(module_name, config)
     config.execute_actions()
 
-def grok_component(name, component,
-                   context=None, module_info=None, templates=None):
-    if module_info is None:
-        obj_module = getattr(component, '__grok_module__', None)
-        if obj_module is None:
-            obj_module = getattr(component, '__module__', None)
-        module_info = scan.module_info_from_dotted_name(obj_module)
 
-    module = module_info.getModule()
-    if context is not None:
-        grokcore.component.context.set(module, context)
-    if templates is not None:
-        module.__grok_templates__ = templates
-    config = ConfigurationMachine()
-    result = zcml.the_multi_grokker.grok(name, component,
-                                         module_info=module_info,
-                                         config=config)
-    config.execute_actions()
-    return result
 
-def warn(message, category=None, stacklevel=1):
-    """Intended to replace warnings.warn in tests.
+class Zope2FunctionalLayer(ZCMLFileLayer):
 
-    Modified copy from zope.deprecation.tests to:
+    def setUp(self):
+        super(Zope2FunctionalLayer, self).setUp()
+        ZopeLite.setUp()
 
-      * make the signature identical to warnings.warn
-      * to check for *.pyc and *.pyo files.
+    def tearDown(self):
+        ZopeLite.tearDown()
+        super(Zope2FunctionalLayer, self).tearDown()
 
-    When zope.deprecation is fixed, this warn function can be removed again.
-    """
-    print "From five.grok.testing's warn():"
 
-    frame = sys._getframe(stacklevel)
-    path = frame.f_globals['__file__']
-    if path.endswith('.pyc') or path.endswith('.pyo'):
-        path = path[:-1]
+FunctionalLayer = Zope2FunctionalLayer(five.grok)
 
-    file = open(path)
-    lineno = frame.f_lineno
-    for i in range(lineno):
-        line = file.readline()
-
-    print "%s:%s: %s: %s\n  %s" % (
-        path,
-        frame.f_lineno,
-        category.__name__,
-        message,
-        line.strip(),
-        )
-
-
-from zope.app.testing.placelesssetup import tearDown as _cleanUp
-def cleanUp():
-    '''Cleans up the component architecture.'''
-    _cleanUp()
-    import Products.Five.zcml as zcml
-    zcml._initialized = 0
-
-def setDebugMode(mode):
-    '''Allows manual setting of Five's inspection of debug mode
-       to allow for ZCML to fail meaningfully.
-    '''
-    import Products.Five.fiveconfigure as fc
-    fc.debug_mode = mode
-
-import five.grok
-def safe_load_site():
-    '''Loads entire component architecture (w/ debug mode on).'''
-    cleanUp()
-    setDebugMode(1)
-    import Products.Five.zcml as zcml
-    zcml.load_site()
-    zcml.load_config('ftesting.zcml', five.grok)
-    setDebugMode(0)
-
-class Layer:
-
-    def setUp(cls):
-        '''Sets up the CA by loading etc/site.zcml.'''
-        safe_load_site()
-    setUp = classmethod(setUp)
-
-    def tearDown(cls):
-        '''Cleans up the CA.'''
-        cleanUp()
-    tearDown = classmethod(tearDown)
-
-GrokFunctionalLayer = Layer
-

Modified: five.grok/branches/sylvain-zope213/src/five/grok/tests/adapters.py
===================================================================
--- five.grok/branches/sylvain-zope213/src/five/grok/tests/adapters.py	2010-11-01 20:37:57 UTC (rev 118117)
+++ five.grok/branches/sylvain-zope213/src/five/grok/tests/adapters.py	2010-11-01 20:41:34 UTC (rev 118118)
@@ -1,6 +1,8 @@
-"""Testing that grokcore adapters work under Zope2
+"""
+Testing that grokcore adapters work under Zope2:
 
-  >>> grok.testing.grok(__name__)
+  >>> from five.grok.tests.adapters import *
+  >>> grok.testing.grok('five.grok.tests.adapters')
 
   >>> from OFS.SimpleItem import SimpleItem
   >>> item = SimpleItem()
@@ -10,7 +12,7 @@
   True
   >>> IId.providedBy(adapted)
   True
-  
+
   >>> adapted.id()
   'item'
 
@@ -20,7 +22,7 @@
 from OFS.interfaces import ISimpleItem
 
 class IId(Interface):
-    
+
     def id():
         """Returns the ID of the object"""
 

Modified: five.grok/branches/sylvain-zope213/src/five/grok/tests/annotation.py
===================================================================
--- five.grok/branches/sylvain-zope213/src/five/grok/tests/annotation.py	2010-11-01 20:37:57 UTC (rev 118117)
+++ five.grok/branches/sylvain-zope213/src/five/grok/tests/annotation.py	2010-11-01 20:41:34 UTC (rev 118118)
@@ -1,9 +1,9 @@
 """
-  >>> grok.testing.grok(__name__)
-  >>> from zope import component
-  >>> from zope.annotation.attribute import AttributeAnnotations
-  >>> component.provideAdapter(AttributeAnnotations)
+Testing that grokcore annotation work under Zope2:
 
+  >>> from five.grok.tests.annotation import *
+  >>> grok.testing.grok('five.grok.tests.annotation')
+
 We can adapt a model to an annotation interface and obtain a
 persistent annotation storage:
 

Deleted: five.grok/branches/sylvain-zope213/src/five/grok/tests/doctest.py
===================================================================
--- five.grok/branches/sylvain-zope213/src/five/grok/tests/doctest.py	2010-11-01 20:37:57 UTC (rev 118117)
+++ five.grok/branches/sylvain-zope213/src/five/grok/tests/doctest.py	2010-11-01 20:41:34 UTC (rev 118118)
@@ -1,43 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
-five.grok
-
-$Id$
-"""
-import re
-import os.path
-
-
-def doctestToPython(filenameInput, filenameOutput):
-    assert os.path.exists(filenameInput)
-    docFileR = open(filenameInput, 'r')
-    newLines = []
-    originalLines = []
-    for line in docFileR.readlines():
-        originalLines.append(line)
-        if '<<<' in line:
-            match = re.match(re.compile('(\s+<<<\s)(.*)'), line)
-            if match:
-                grokCodeFlag = True
-                newLines.append("%s\n" % match.groups()[1])
-        elif '...' in line and grokCodeFlag == True:
-            match = re.match(re.compile('(\s+\.\.\.\s)(.*)'), line)
-            if match:
-                newLines.append("%s\n" % match.groups()[1])
-        elif '<<<' not in line or '...' not in line: # handle comments
-            grokCodeFlag = False
-            newLines.append('#%s' % line)
-
-    docFileR.close()
-
-    docFileW = open(filenameOutput, 'w')
-    for newLine in newLines:
-        if newLine.strip() != '#':
-            docFileW.write('%s' % newLine)
-        else:
-            docFileW.write('\n')
-    docFileW.close()
-
-
-if __name__ == '__main__':
-    doctestToPython('../README.txt', '../README.txt.out')

Modified: five.grok/branches/sylvain-zope213/src/five/grok/tests/multiadapter.py
===================================================================
--- five.grok/branches/sylvain-zope213/src/five/grok/tests/multiadapter.py	2010-11-01 20:37:57 UTC (rev 118117)
+++ five.grok/branches/sylvain-zope213/src/five/grok/tests/multiadapter.py	2010-11-01 20:41:34 UTC (rev 118118)
@@ -1,10 +1,9 @@
 """
-Testing that grokcore multiadapters work under Zope2
+Testing that grokcore multiadapters work under Zope2:
 
-__init__():
+  >>> from five.grok.tests.multiadapter import *
+  >>> grok.testing.grok('five.grok.tests.multiadapter')
 
-  >>> grok.testing.grok(__name__)
-
   >>> cave = Cave()
   >>> fireplace = Fireplace()
 

Modified: five.grok/branches/sylvain-zope213/src/five/grok/tests/resource.py
===================================================================
--- five.grok/branches/sylvain-zope213/src/five/grok/tests/resource.py	2010-11-01 20:37:57 UTC (rev 118117)
+++ five.grok/branches/sylvain-zope213/src/five/grok/tests/resource.py	2010-11-01 20:41:34 UTC (rev 118118)
@@ -1,6 +1,7 @@
 """
 It is an error for the 'static' directory to be a python package:
 
+  >>> from five.grok.tests.resource import *
   >>> grok.testing.grok('five.grok.tests.all.staticispackage')
   Traceback (most recent call last):
     ...

Modified: five.grok/branches/sylvain-zope213/src/five/grok/tests/subscribers.py
===================================================================
--- five.grok/branches/sylvain-zope213/src/five/grok/tests/subscribers.py	2010-11-01 20:37:57 UTC (rev 118117)
+++ five.grok/branches/sylvain-zope213/src/five/grok/tests/subscribers.py	2010-11-01 20:41:34 UTC (rev 118118)
@@ -1,6 +1,8 @@
-"""Testing that grokcore subscribers work under Zope2
+"""
+Testing that grokcore subscribers work under Zope2:
 
-  >>> grok.testing.grok(__name__)
+  >>> from five.grok.tests.subscribers import *
+  >>> grok.testing.grok('five.grok.tests.subscribers')
 
 You can subscribe to events using the @grok.subscribe decorator:
 

Modified: five.grok/branches/sylvain-zope213/src/five/grok/tests/test_all.py
===================================================================
--- five.grok/branches/sylvain-zope213/src/five/grok/tests/test_all.py	2010-11-01 20:37:57 UTC (rev 118117)
+++ five.grok/branches/sylvain-zope213/src/five/grok/tests/test_all.py	2010-11-01 20:41:34 UTC (rev 118118)
@@ -1,117 +1,35 @@
+##############################################################################
+#
+# Copyright (c) 2007 Zope Foundation and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+
 import unittest
-from pkg_resources import resource_listdir
+import doctest
 
-from zope.testing import doctestunit, doctest
-from zope.component import testing
+from Testing.ZopeTestCase import FunctionalDocTestSuite
+from five.grok.testing import FunctionalLayer
 
-import Products.Five
-from Products.Five import zcml
 
-import five.grok
-from five.grok.tests.doctest import doctestToPython
-import os
+options = doctest.ELLIPSIS+doctest.NORMALIZE_WHITESPACE
 
-from Testing.ZopeTestCase.layer import ZopeLite as ZopeLiteLayer
 
-def setUp(test=None):
-    testing.setUp(test)
-    zcml.load_config('meta.zcml', package=Products.Five)
-    zcml.load_config('configure.zcml', package=Products.Five)
-    zcml.load_config('meta.zcml', package=five.grok)
-    zcml.load_config('configure.zcml', package=five.grok)
-    zcml.load_config('configure.zcml', package=five.grok.tests)
-
-from five.grok.testing import grok
-from zope import component
-
-
-def setUpWithGrokDoctest(test=None):
-    testing.setUp(test)
-    testFile = test.globs.get('__file__')
-    testFileDirName, testFullFileName = os.path.split(testFile)
-    testFileName, testFileExt = os.path.splitext(testFullFileName)
-    pythonTestFile = os.path.join(testFileDirName, testFileName + '.py')
-    doctestToPython(testFile, pythonTestFile)
-    component.eventtesting.setUp()
-    #XXX this should be done by the GrokDocFileSuite
-    grok('five.grok.README')
-    from zope.traversing.adapters import DefaultTraversable
-    component.provideAdapter(DefaultTraversable, [None])
-
-
-def tearDownWithGrokDoctest(test=None):
-    testing.tearDown(test)
-    testFile = test.globs.get('__file__')
-    testFileDirName, testFullFileName = os.path.split(testFile)
-    testFileName, testFileExt = os.path.splitext(testFullFileName)
-    pythonTestFile = os.path.join(testFileDirName, testFileName + '.py')
-    os.remove(pythonTestFile)
-    pythonPycTestFile = os.path.join(testFileDirName, testFileName + '.pyc')
-    if os.path.exists(pythonPycTestFile):
-        os.remove(pythonPycTestFile)
-
-
-def suiteFromPackage(name):
-    files = resource_listdir(__name__, name)
+def test_suite():
     suite = unittest.TestSuite()
-    for filename in files:
-        if not filename.endswith('.py'):
-            continue
-        if filename.endswith('_fixture.py'):
-            continue
-        if filename == '__init__.py':
-            continue
 
-        dottedname = 'five.grok.tests.%s.%s' % (name, filename[:-3])
-        test = doctest.DocTestSuite(dottedname,
-                                    setUp=setUp,
-                                    tearDown=testing.tearDown,
-                                    optionflags=doctest.ELLIPSIS+
-                                                doctest.NORMALIZE_WHITESPACE)
-
+    for name in ['adapters', 'annotation', 'multiadapter', 'utilities',
+                 'subscribers', 'resource']:
+        test = FunctionalDocTestSuite(
+            module='five.grok.tests.%s' % name,
+            optionflags=options)
+        test.layer = FunctionalLayer
         suite.addTest(test)
     return suite
-
-
-def test_suite():
-    
-    readmeSuite = doctestunit.DocFileSuite(
-            'README.txt', package='five.grok',
-            setUp=setUpWithGrokDoctest, tearDown=tearDownWithGrokDoctest,
-            optionflags=doctest.ELLIPSIS+
-                        doctest.NORMALIZE_WHITESPACE)
-    readmeSuite.layer = ZopeLiteLayer
-    
-    return unittest.TestSuite([
-
-        # Unit tests for your API
-        readmeSuite,
-
-        doctestunit.DocTestSuite(
-            module='five.grok.tests.adapters',
-            setUp=setUp, tearDown=testing.tearDown),
-
-        doctestunit.DocTestSuite(
-            module='five.grok.tests.annotation',
-            setUp=setUp, tearDown=testing.tearDown),
-
-        doctestunit.DocTestSuite(
-            module='five.grok.tests.multiadapter',
-            setUp=setUp, tearDown=testing.tearDown),
-
-        doctestunit.DocTestSuite(
-            module='five.grok.tests.utilities',
-            setUp=setUp, tearDown=testing.tearDown),
-
-        doctestunit.DocTestSuite(
-            module='five.grok.tests.subscribers',
-            setUp=setUp, tearDown=testing.tearDown),
-
-        doctestunit.DocTestSuite(
-            module='five.grok.tests.resource',
-            setUp=setUp, tearDown=testing.tearDown),
-        ])
-
-
-if __name__ == '__main__':
-    unittest.main(defaultTest='test_suite')

Modified: five.grok/branches/sylvain-zope213/src/five/grok/tests/utilities.py
===================================================================
--- five.grok/branches/sylvain-zope213/src/five/grok/tests/utilities.py	2010-11-01 20:37:57 UTC (rev 118117)
+++ five.grok/branches/sylvain-zope213/src/five/grok/tests/utilities.py	2010-11-01 20:41:34 UTC (rev 118118)
@@ -1,7 +1,10 @@
-"""Testing that grokcore utilities work under Zope2
+"""
 
-  >>> grok.testing.grok(__name__)
+Testing that grokcore utilities work under Zope2:
 
+  >>> from five.grok.tests.utilities import *
+  >>> grok.testing.grok('five.grok.tests.utilities')
+
   >>> from zope import component
   >>> club = component.getUtility(IFiveClub, 'five_inch')
   >>> IFiveClub.providedBy(club)



More information about the checkins mailing list