summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris McDonough <chrism@plope.com>2012-01-05 09:07:33 -0500
committerChris McDonough <chrism@plope.com>2012-01-05 09:07:33 -0500
commit933944c12cf09c2818ebf9f82e9c0c3efd5f1d41 (patch)
treea432d27ffdd3ef26826f40188c930a1a81d18711
parent962816fb573547e59a4c376c25e11b0597eee9d6 (diff)
downloadpyramid-933944c12cf09c2818ebf9f82e9c0c3efd5f1d41.tar.gz
pyramid-933944c12cf09c2818ebf9f82e9c0c3efd5f1d41.tar.bz2
pyramid-933944c12cf09c2818ebf9f82e9c0c3efd5f1d41.zip
fix test on py3
-rw-r--r--pyramid/tests/test_urldispatch.py12
1 files changed, 9 insertions, 3 deletions
diff --git a/pyramid/tests/test_urldispatch.py b/pyramid/tests/test_urldispatch.py
index 370f072ff..d7dd2f44a 100644
--- a/pyramid/tests/test_urldispatch.py
+++ b/pyramid/tests/test_urldispatch.py
@@ -1,7 +1,9 @@
import unittest
from pyramid import testing
-from pyramid.compat import text_
-from pyramid.compat import native_
+from pyramid.compat import (
+ text_,
+ PY3,
+ )
class TestRoute(unittest.TestCase):
def _getTargetClass(self):
@@ -118,7 +120,11 @@ class RoutesMapperTests(unittest.TestCase):
def test___call__pathinfo_cant_be_decoded(self):
from pyramid.exceptions import URLDecodeError
mapper = self._makeOne()
- request = self._getRequest(PATH_INFO=b'\xff\xfe\xe6\x00')
+ if PY3:
+ path_info = b'\xff\xfe\xe6\x00'.decode('latin-1')
+ else:
+ path_info = b'\xff\xfe\xe6\x00'
+ request = self._getRequest(PATH_INFO=path_info)
self.assertRaises(URLDecodeError, mapper, request)
def test___call__route_matches(self):