diff options
| author | ejucovy@socialplanning <ejucovy@socialplanning> | 2011-03-25 08:17:51 -0400 |
|---|---|---|
| committer | ejucovy@socialplanning <ejucovy@socialplanning> | 2011-03-25 08:17:51 -0400 |
| commit | d0eaa48920f1bcf24e6afefbe1340407c49a700b (patch) | |
| tree | b51ac711f009f2b000f439c3c91f53c4aeb6c29a /webtest/__init__.py | |
| parent | e532eb2c9a16c9a240c4894459bda678dfc8e39d (diff) | |
| download | webtest-d0eaa48920f1bcf24e6afefbe1340407c49a700b.tar.gz | |
add TestApp.RequestClass so that custom request/response subclasses can be used in subclasses of TestApp
Diffstat (limited to 'webtest/__init__.py')
| -rw-r--r-- | webtest/__init__.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/webtest/__init__.py b/webtest/__init__.py index ad9e671..d51c9be 100644 --- a/webtest/__init__.py +++ b/webtest/__init__.py @@ -626,6 +626,7 @@ class TestApp(object): # for py.test disabled = True + RequestClass = TestRequest def __init__(self, app, extra_environ=None, relative_to=None, use_unicode=True): """ @@ -722,7 +723,7 @@ class TestApp(object): else: environ['QUERY_STRING'] = '' url = self._remove_fragment(url) - req = TestRequest.blank(url, environ) + req = self.RequestClass.blank(url, environ) if headers: req.headers.update(headers) return self.do_request(req, status=status, @@ -757,7 +758,7 @@ class TestApp(object): environ['REQUEST_METHOD'] = method environ['wsgi.input'] = StringIO(params) url = self._remove_fragment(url) - req = TestRequest.blank(url, environ) + req = self.RequestClass.blank(url, environ) if headers: req.headers.update(headers) return self.do_request(req, status=status, @@ -896,7 +897,7 @@ class TestApp(object): method to ``POST`` """ if isinstance(url_or_req, basestring): - req = TestRequest.blank(url_or_req, **req_params) + req = self.RequestClass.blank(url_or_req, **req_params) else: req = url_or_req.copy() for name, value in req_params.iteritems(): |
