diff options
Diffstat (limited to 'tests/test_urlmap.py')
-rw-r--r-- | tests/test_urlmap.py | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/tests/test_urlmap.py b/tests/test_urlmap.py index 9f77ca2..f7ec729 100644 --- a/tests/test_urlmap.py +++ b/tests/test_urlmap.py @@ -1,11 +1,15 @@ from paste.urlmap import * from paste.fixture import * +import six def make_app(response_text): def app(environ, start_response): headers = [('Content-type', 'text/html')] start_response('200 OK', headers) - return [response_text % environ] + body = response_text % environ + if six.PY3: + body = body.encode('ascii') + return [body] return app def test_map(): @@ -44,6 +48,6 @@ def test_404(): mapper = URLMap({}) app = TestApp(mapper, extra_environ={'HTTP_ACCEPT': 'text/html'}) res = app.get("/-->%0D<script>alert('xss')</script>", status=404) - assert '--><script' not in res.body + assert b'--><script' not in res.body res = app.get("/--%01><script>", status=404) - assert '--\x01><script>' not in res.body + assert b'--\x01><script>' not in res.body |