Comments (2)
I would expect behavior along these lines:
diff --git a/webtest/app.py b/webtest/app.py
index 32a0ef9..524972d 100644
--- a/webtest/app.py
+++ b/webtest/app.py
@@ -799,11 +799,13 @@ class TestApp(object):
environ['QUERY_STRING'] = ''
if content_type is not None:
environ['CONTENT_TYPE'] = content_type
- environ['CONTENT_LENGTH'] = str(len(params))
environ['REQUEST_METHOD'] = method
- environ['wsgi.input'] = BytesIO(to_bytes(params))
url = self._remove_fragment(url)
req = self.RequestClass.blank(url, environ)
+ if isinstance(params, text_type):
+ req.text = params
+ else:
+ req.body = params
if headers:
req.headers.update(headers)
return self.do_request(req, status=status,
from webtest.
using req.text/body break some tests. but I've found another workaround and added a test. Thanks for the report.
from webtest.
Related Issues (20)
- Add docs build to Travis-CI HOT 2
- Session cookie is not passed with request HOT 2
- Add GitHub templates for support HOT 11
- Default value for button and submit is wrong HOT 6
- Webtest fails with PYTHONOPTIMIZE=2 HOT 1
- `MultipleSelect().value = []` doesn't work HOT 2
- webtest.forms.Radio() pays no attention to the 'disabled' attribute of <input type="radio"> HOT 1
- Can we (optionally) allow for malformed JSON content when testing? HOT 3
- urllib.parse.splithost() is deprecated as of 3.8 HOT 2
- Forms with default action wrongly submit to "/" HOT 1
- head() got an unexpected keyword argument 'params'
- Fix simple typo: requets -> requests
- Is there any way to open a popup form when click? HOT 2
- Allow checking client-side validation during form submit HOT 2
- TestResponse.lxml raises ValueError on XML responses due to ElementTree construction from unicode string
- Can't have more then 1 form in html HOT 2
- Multiple file input support
- DELETE params does not behave like GET
- PyQuery object doesn't use the correct parser
- Prettify HTML output
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from webtest.