Example #1
0
 def _createRequest(self, path, **kw):
     publication = DefaultPublication(self.app)
     path = path.split('/')
     path.reverse()
     request = TestRequest(StringIO(''), **kw)
     request.setTraversalStack(path)
     request.setPublication(publication)
     return request
Example #2
0
    def _createRequest(self, extra_env={}, body=b""):
        env = self._testEnv.copy()
        env.update(extra_env)
        if len(body):
            env['CONTENT_LENGTH'] = str(len(body))

        publication = DefaultPublication(self.app)
        instream = BytesIO(body)
        request = HTTPRequest(instream, env)
        request.setPublication(publication)
        return request
Example #3
0
 def testImplementsIPublication(self):
     self.failUnless(IPublication.providedBy(
                         DefaultPublication(self.app)))
 def testImplementsIPublication(self):
     self.assertTrue(IPublication.providedBy(DefaultPublication(self.app)))