From 70381b1ac56348c025261f1e7300e0b63891d363 Mon Sep 17 00:00:00 2001 From: Michael Merickel Date: Thu, 7 Nov 2013 19:24:20 -0600 Subject: fix tests --- pyramid/config/views.py | 4 +--- pyramid/tests/test_url.py | 2 +- pyramid/url.py | 5 +---- 3 files changed, 3 insertions(+), 8 deletions(-) diff --git a/pyramid/config/views.py b/pyramid/config/views.py index 022984420..0a47d869a 100644 --- a/pyramid/config/views.py +++ b/pyramid/config/views.py @@ -36,8 +36,6 @@ from pyramid.interfaces import ( from pyramid import renderers from pyramid.compat import ( - native_, - text_type, string_types, urlparse, url_quote, @@ -1912,7 +1910,7 @@ class StaticURLInfo(object): result = urljoin(url, subpath) if '_query' in kw: query = kw.pop('_query') - if isinstance(query, text_type): + if isinstance(query, string_types): result += '?' + quote_plus(query) elif query: result += '?' + urlencode(query, doseq=True) diff --git a/pyramid/tests/test_url.py b/pyramid/tests/test_url.py index 80dbd7001..cbbb933a7 100644 --- a/pyramid/tests/test_url.py +++ b/pyramid/tests/test_url.py @@ -162,7 +162,7 @@ class TestURLMethodsMixin(unittest.TestCase): self.assertEqual(result, 'http://example.com:5432/context/#La+Pe%C3%B1a') - def test_resource_url_anchor_is_not_urlencoded(self): + def test_resource_url_anchor_is_urlencoded(self): request = self._makeOne() self._registerResourceURL(request.registry) context = DummyContext() diff --git a/pyramid/url.py b/pyramid/url.py index eb9b364d9..4384e9cd6 100644 --- a/pyramid/url.py +++ b/pyramid/url.py @@ -12,10 +12,8 @@ from pyramid.interfaces import ( ) from pyramid.compat import ( - native_, bytes_, string_types, - text_type, url_quote, ) from pyramid.encode import ( @@ -593,8 +591,7 @@ class URLMethodsMixin(object): if 'anchor' in kw: anchor = kw['anchor'] - if isinstance(anchor, text_type): - anchor = quote_plus(anchor) + anchor = quote_plus(anchor) anchor = '#' + anchor if elements: -- cgit v1.2.3