diff options
| author | Ian Bicking <ianb@colorstudy.com> | 2010-07-23 14:22:29 -0500 |
|---|---|---|
| committer | Ian Bicking <ianb@colorstudy.com> | 2010-07-23 14:22:29 -0500 |
| commit | 7ec9f5c6f7a0bc319e66e942ed862bc85cec9e74 (patch) | |
| tree | 106174b1091f4d4589b28766ffc860d31704a751 /webtest/__init__.py | |
| parent | 0bba3f1b9c1d38761fcce21d82eab5e04a1e5875 (diff) | |
| download | webtest-7ec9f5c6f7a0bc319e66e942ed862bc85cec9e74.tar.gz | |
Fix sending a webob request directly into methods
Diffstat (limited to 'webtest/__init__.py')
| -rw-r--r-- | webtest/__init__.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/webtest/__init__.py b/webtest/__init__.py index 461654c..179c616 100644 --- a/webtest/__init__.py +++ b/webtest/__init__.py @@ -313,9 +313,11 @@ class TestApp(object): if isinstance(url_or_req, basestring): req = TestRequest.blank(url_or_req, **req_params) else: - req = req.copy() + req = url_or_req.copy() for name, value in req_params.iteritems(): setattr(req, name, value) + if req.content_length == -1: + req.content_length = len(req.body) req.environ['paste.throw_errors'] = True req.environ.update(self.extra_environ) return self.do_request(req, status=status, expect_errors=expect_errors) |
