Index: /main/waeup.sirp/trunk/src/waeup/sirp/README.txt
===================================================================
--- /main/waeup.sirp/trunk/src/waeup/sirp/README.txt	(revision 5139)
+++ /main/waeup.sirp/trunk/src/waeup/sirp/README.txt	(revision 5140)
@@ -2,16 +2,8 @@
 **********************
 
-:Test-Layer: unit
+.. :doctest:
+.. :layer: waeup.sirp.testing.WAeUPSIRPUnitTestLayer
 
 A portal software for student registration.
-
-Prerequisites
-=============
-
-Before we can work with the environment, we have to register all the
-utilities, adapters, etc. We grok the `waeup` package to do that::
-
-  >>> import grok
-  >>> grok.testing.grok('waeup.sirp')
 
 Universities
Index: /main/waeup.sirp/trunk/src/waeup/sirp/app.txt
===================================================================
--- /main/waeup.sirp/trunk/src/waeup/sirp/app.txt	(revision 5139)
+++ /main/waeup.sirp/trunk/src/waeup/sirp/app.txt	(revision 5140)
@@ -2,5 +2,6 @@
 **************************************************************
 
-:Test-Layer: unit
+.. :doctest:
+.. :layer: waeup.sirp.testing.WAeUPSIRPUnitTestLayer
 
 .. module:: waeup.sirp.app
@@ -31,8 +32,5 @@
 whole :mod:`waeup` package. This way all interfaces, utilities and adapters
 defined in the package are looked up and registered with the global
-registries:
-
-    >>> import grok
-    >>> grok.testing.grok('waeup')
+registries (this is done by the testlayer automatically).
 
 Now we can import the :class:`University` class and create an
Index: /main/waeup.sirp/trunk/src/waeup/sirp/catalog.txt
===================================================================
--- /main/waeup.sirp/trunk/src/waeup/sirp/catalog.txt	(revision 5139)
+++ /main/waeup.sirp/trunk/src/waeup/sirp/catalog.txt	(revision 5140)
@@ -8,5 +8,5 @@
 
 .. :doctest:
-
+.. :layer: waeup.sirp.testing.WAeUPSIRPUnitTestLayer
 
 .. contents::
Index: /main/waeup.sirp/trunk/src/waeup/sirp/datacenter.txt
===================================================================
--- /main/waeup.sirp/trunk/src/waeup/sirp/datacenter.txt	(revision 5139)
+++ /main/waeup.sirp/trunk/src/waeup/sirp/datacenter.txt	(revision 5140)
@@ -4,5 +4,6 @@
 The WAeUP data center cares for managing CSV files and importing then.
 
-:Test-Layer: unit
+.. :doctest:
+.. :layer: waeup.sirp.testing.WAeUPSIRPUnitTestLayer
 
 Creating a data center
Index: /main/waeup.sirp/trunk/src/waeup/sirp/hostel/hostelcontainer.txt
===================================================================
--- /main/waeup.sirp/trunk/src/waeup/sirp/hostel/hostelcontainer.txt	(revision 5139)
+++ /main/waeup.sirp/trunk/src/waeup/sirp/hostel/hostelcontainer.txt	(revision 5140)
@@ -4,5 +4,6 @@
 Containers for hostels.
 
-:Test-Layer: unit
+.. :doctest:
+.. :layer: waeup.sirp.testing.WAeUPSIRPUnitTestLayer
 
 Getting a hostel container
@@ -22,10 +23,6 @@
 Another way to get a hostel container -- without importing the class
 -- is via factories. We registered a factory for hostel containers
-under the name ``waeup.HostelContainer``::
-
-    >>> import grok
-    >>> grok.testing.grok('waeup')
-
-Now we can ask for an object by calling the appropriate factory:
+under the name ``waeup.HostelContainer``. So we can ask for an object
+by calling the appropriate factory:
 
     >>> from zope.component import createObject
Index: /main/waeup.sirp/trunk/src/waeup/sirp/permissions.txt
===================================================================
--- /main/waeup.sirp/trunk/src/waeup/sirp/permissions.txt	(revision 5139)
+++ /main/waeup.sirp/trunk/src/waeup/sirp/permissions.txt	(revision 5140)
@@ -4,13 +4,6 @@
 Permissions and roles used in a WAeUP portal.
 
-:Test-Layer: unit
-
-
-Before we can do something useful with roles and permissions, we have
-to register them. This can be done simply by grokking the `waeup`
-package:
-
-    >>> import grok
-    >>> grok.testing.grok('waeup')
+.. :doctest:
+.. :layer: waeup.sirp.testing.WAeUPSIRPUnitTestLayer
 
 We can get all roles defined in a WAeUP portal:
Index: /main/waeup.sirp/trunk/src/waeup/sirp/university/certificate.txt
===================================================================
--- /main/waeup.sirp/trunk/src/waeup/sirp/university/certificate.txt	(revision 5139)
+++ /main/waeup.sirp/trunk/src/waeup/sirp/university/certificate.txt	(revision 5140)
@@ -6,12 +6,6 @@
 Components that represent and manage certificates.
 
-:Test-Layer: unit
-
-Because certificates make use of components registered with the Zope
-Component Architecture (ZCA), we first have to grok the `waeup`
-package. This happens automatically in real-world use:
-
-    >>> import grok
-    >>> grok.testing.grok('waeup')
+.. :doctest:
+.. :layer: waeup.sirp.testing.WAeUPSIRPUnitTestLayer
 
 
Index: /main/waeup.sirp/trunk/src/waeup/sirp/university/certificatecontainer.txt
===================================================================
--- /main/waeup.sirp/trunk/src/waeup/sirp/university/certificatecontainer.txt	(revision 5139)
+++ /main/waeup.sirp/trunk/src/waeup/sirp/university/certificatecontainer.txt	(revision 5140)
@@ -6,13 +6,7 @@
 Containers for certificates.
 
-:Test-Layer: unit
+.. :doctest:
+.. :layer: waeup.sirp.testing.WAeUPSIRPUnitTestLayer
 
-Because this module makes use of components registered with the Zope
-Component Architecture (ZCA), we first have to grok the `waeup`
-package if we want to deploy it. This happens automatically in
-real-world use:
-
-    >>> import grok
-    >>> grok.testing.grok('waeup')
 
 Content Classes (models and containers)
Index: /main/waeup.sirp/trunk/src/waeup/sirp/university/course.txt
===================================================================
--- /main/waeup.sirp/trunk/src/waeup/sirp/university/course.txt	(revision 5139)
+++ /main/waeup.sirp/trunk/src/waeup/sirp/university/course.txt	(revision 5140)
@@ -6,13 +6,6 @@
 Components that represent courses.
 
-:Test-Layer: unit
-
-Because this module makes use of components registered with the Zope
-Component Architecture (ZCA), we first have to grok the `waeup`
-package if we want to deploy it. This happens automatically in
-real-world use:
-
-    >>> import grok
-    >>> grok.testing.grok('waeup')
+.. :doctest:
+.. :layer: waeup.sirp.testing.WAeUPSIRPUnitTestLayer
 
 Content Classes (models and containers)
Index: /main/waeup.sirp/trunk/src/waeup/sirp/university/coursecontainer.txt
===================================================================
--- /main/waeup.sirp/trunk/src/waeup/sirp/university/coursecontainer.txt	(revision 5139)
+++ /main/waeup.sirp/trunk/src/waeup/sirp/university/coursecontainer.txt	(revision 5140)
@@ -6,13 +6,7 @@
 Containers for courses.
 
-:Test-Layer: unit
+.. :doctest:
+.. :layer: waeup.sirp.testing.WAeUPSIRPUnitTestLayer
 
-Because this module makes use of components registered with the Zope
-Component Architecture (ZCA), we first have to grok the `waeup`
-package if we want to deploy it. This happens automatically in
-real-world use:
-
-    >>> import grok
-    >>> grok.testing.grok('waeup')
 
 Content Classes (models and containers)
Index: /main/waeup.sirp/trunk/src/waeup/sirp/university/department.txt
===================================================================
--- /main/waeup.sirp/trunk/src/waeup/sirp/university/department.txt	(revision 5139)
+++ /main/waeup.sirp/trunk/src/waeup/sirp/university/department.txt	(revision 5140)
@@ -6,12 +6,6 @@
 Components that represent university departments.
 
-:Test-Layer: unit
-
-Before we can create departments, we have to grok the :mod:`waeup`
-package. This happens automatically in real-world use:
-
-    >>> import grok
-    >>> grok.testing.grok('waeup')
-
+.. :doctest:
+.. :layer: waeup.sirp.testing.WAeUPSIRPUnitTestLayer
 
 Content Classes (models and containers)
Index: /main/waeup.sirp/trunk/src/waeup/sirp/university/faculty.txt
===================================================================
--- /main/waeup.sirp/trunk/src/waeup/sirp/university/faculty.txt	(revision 5139)
+++ /main/waeup.sirp/trunk/src/waeup/sirp/university/faculty.txt	(revision 5140)
@@ -6,11 +6,7 @@
 Components that represent university faculties.
 
-:Test-Layer: unit
-
-Before we can create faculties, we have to grok the :mod:`waeup`
-package. This happens automatically in real-world use:
-
-    >>> import grok
-    >>> grok.testing.grok('waeup')
+.. :doctest:
+.. :layer: waeup.sirp.testing.WAeUPSIRPUnitTestLayer
+
 
 Content Classes (models and containers)
Index: /main/waeup.sirp/trunk/src/waeup/sirp/university/facultycontainer.txt
===================================================================
--- /main/waeup.sirp/trunk/src/waeup/sirp/university/facultycontainer.txt	(revision 5139)
+++ /main/waeup.sirp/trunk/src/waeup/sirp/university/facultycontainer.txt	(revision 5140)
@@ -6,12 +6,6 @@
 Components that represent faculty containers.
 
-:Test-Layer: unit
-
-Before we can create faculty containers, we have to grok the
-:mod:`waeup.sirp` package. This happens automatically in real-world
-use:
-
-    >>> import grok
-    >>> grok.testing.grok('waeup.sirp')
+.. :doctest:
+.. :layer: waeup.sirp.testing.WAeUPSIRPUnitTestLayer
 
 
Index: /main/waeup.sirp/trunk/src/waeup/sirp/users.txt
===================================================================
--- /main/waeup.sirp/trunk/src/waeup/sirp/users.txt	(revision 5139)
+++ /main/waeup.sirp/trunk/src/waeup/sirp/users.txt	(revision 5140)
@@ -2,5 +2,6 @@
 *************************
 
-:Test-Layer: unit
+.. :doctest:
+.. :layer: waeup.sirp.testing.WAeUPSIRPUnitTestLayer
 
 Before we can start, we need some password managers available:
Index: /main/waeup.sirp/trunk/src/waeup/sirp/utils/converters.txt
===================================================================
--- /main/waeup.sirp/trunk/src/waeup/sirp/utils/converters.txt	(revision 5139)
+++ /main/waeup.sirp/trunk/src/waeup/sirp/utils/converters.txt	(revision 5140)
@@ -9,11 +9,7 @@
 
 
-:Test-Layer: unit
-
-As converters are registered as adapters, we have to grok the package
-first:
-
-    >>> import grok
-    >>> grok.testing.grok('waeup')
+.. :doctest:
+.. :layer: waeup.sirp.testing.WAeUPSIRPUnitTestLayer
+
 
 Constants
Index: /main/waeup.sirp/trunk/src/waeup/sirp/utils/helpers.txt
===================================================================
--- /main/waeup.sirp/trunk/src/waeup/sirp/utils/helpers.txt	(revision 5139)
+++ /main/waeup.sirp/trunk/src/waeup/sirp/utils/helpers.txt	(revision 5140)
@@ -6,5 +6,5 @@
 Helper functions for the WAeUP SRP.
 
-:Test-Layer: unit
+.. :doctest:
 
 :func:`removeFileOrDirectory`
Index: /main/waeup.sirp/trunk/src/waeup/sirp/utils/importexport.txt
===================================================================
--- /main/waeup.sirp/trunk/src/waeup/sirp/utils/importexport.txt	(revision 5139)
+++ /main/waeup.sirp/trunk/src/waeup/sirp/utils/importexport.txt	(revision 5140)
@@ -5,5 +5,6 @@
 exportable and importable.
 
-:Test-Layer: unit
+.. :doctest:
+.. :layer: waeup.sirp.testing.WAeUPSIRPUnitTestLayer
 
 As imports and exports of data are a cruical point when doing updates
@@ -13,8 +14,7 @@
 Exports and imports are implemented using the Zope component framework
 capabilities. This means we need some adapters and utilities, which we
-register, by grokking the whole package::
-
-    >>> import grok
-    >>> grok.testing.grok('waeup')
+register, by grokking the whole package. This is done on startup
+automatically, but in doctests (like this one) it is done by the
+testlayer.
 
 Furthermore we need something to import/export. As only pickable
Index: /main/waeup.sirp/trunk/src/waeup/sirp/widgets/table.txt
===================================================================
--- /main/waeup.sirp/trunk/src/waeup/sirp/widgets/table.txt	(revision 5139)
+++ /main/waeup.sirp/trunk/src/waeup/sirp/widgets/table.txt	(revision 5140)
@@ -5,5 +5,6 @@
 
 
-:doctest:
+.. :doctest:
+.. :layer: waeup.sirp.testing.WAeUPSIRPUnitTestLayer
 
 Tables
@@ -81,5 +82,4 @@
 
     >>> import grok
-    >>> grok.testing.grok('waeup.sirp')
     >>> from waeup.sirp.widgets.interfaces import ITableProvider
     >>> class TableAdapter(grok.Adapter):
