Back to index

plone3  3.1.7
Classes | Functions
CMFCore.tests.test_CookieCrumbler Namespace Reference

Classes

class  CookieCrumblerTests

Functions

def makerequest
def test_suite

Function Documentation

def CMFCore.tests.test_CookieCrumbler.makerequest (   root,
  stdout,
  stdin = None 
)

Definition at line 23 of file test_CookieCrumbler.py.

00023 
00024 def makerequest(root, stdout, stdin=None):
00025     # Customized version of Testing.makerequest.makerequest()
00026     from cStringIO import StringIO
00027     from ZPublisher.HTTPRequest import HTTPRequest
00028     from ZPublisher.HTTPResponse import HTTPResponse
00029 
00030     resp = HTTPResponse(stdout=stdout)
00031     environ = {}
00032     environ['SERVER_NAME'] = 'example.com'
00033     environ['SERVER_PORT'] = '80'
00034     environ['REQUEST_METHOD'] = 'GET'
00035     if stdin is None:
00036         stdin = StringIO('')  # Empty input
00037     req = HTTPRequest(stdin, environ, resp)
00038     req['PARENTS'] = [root]
00039     return req
00040 

Here is the caller graph for this function:

Definition at line 391 of file test_CookieCrumbler.py.

00391 
00392 def test_suite():
00393     return unittest.TestSuite((
00394         unittest.makeSuite(CookieCrumblerTests),
00395         ))