diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2015-04-21 16:17:27 +0200 |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2015-04-21 16:17:27 +0200 |
commit | 978eddf9923b2aa18898efe273c7fc80347e758c (patch) | |
tree | 5ebdd53d1608ee5e2777e47b0a8993b43288e7cd /tests | |
parent | ebf95ab77b9a2a935cd7fde6dfafb7376627dfc8 (diff) | |
download | paste-git-978eddf9923b2aa18898efe273c7fc80347e758c.tar.gz |
Fix test_request_form on Python 3
* wsgi.input must be a binary file, not a text file
* HTTP body must be bytes
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_request_form.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/test_request_form.py b/tests/test_request_form.py index 036da3e..956802b 100644 --- a/tests/test_request_form.py +++ b/tests/test_request_form.py @@ -1,5 +1,5 @@ import cgi -from six.moves import cStringIO as StringIO +import six from paste.request import * from paste.util.multidict import MultiDict @@ -19,12 +19,12 @@ def make_post(body): 'CONTENT_TYPE': 'application/x-www-form-urlencoded', 'CONTENT_LENGTH': str(len(body)), 'REQUEST_METHOD': 'POST', - 'wsgi.input': StringIO(body), + 'wsgi.input': six.BytesIO(body), } return e def test_parsevars(): - e = make_post('a=1&b=2&c=3&b=4') + e = make_post(b'a=1&b=2&c=3&b=4') cur_input = e['wsgi.input'] d = parse_formvars(e) assert isinstance(d, MultiDict) |