Author: jmorliaguet
Date: Sat Jun 10 12:05:27 2006
New Revision: 3386

Modified:
   cpsskins/branches/paris-sprint-2006/doc/utils.txt

Log:

- added a test for getRequest()



Modified: cpsskins/branches/paris-sprint-2006/doc/utils.txt
==============================================================================
--- cpsskins/branches/paris-sprint-2006/doc/utils.txt   (original)
+++ cpsskins/branches/paris-sprint-2006/doc/utils.txt   Sat Jun 10 12:05:27 2006
@@ -70,3 +70,36 @@
     >>> print camelize(u'some Other CLASS')
     someOtherClass
 
+
+getRequest
+----------
+
+getRequest() returns the request from the current interaction. It is used
+mainly to access the client session storage (via request.cookies) without
+creating a view.
+
+    >>> from zope.publisher.browser import TestRequest
+    >>> from zope.security.management import endInteraction
+    >>> from zope.security.management import newInteraction
+    >>> from zope.security.management import restoreInteraction
+    >>> from cpsskins.utils import getRequest
+
+    >>> endInteraction()
+
+If there is no interaction an exception is raised:
+
+    >>> getRequest()
+    Traceback (most recent call last):
+    ...
+    NoInteraction
+
+    >>> request = TestRequest()
+    >>> newInteraction(request)
+
+otherwise we get the request:
+
+    >>> getRequest() is request
+    True
+
+    >>> restoreInteraction()
+
-- 
http://lists.nuxeo.com/mailman/listinfo/z3lab-checkins

Reply via email to