summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Merickel <michael@merickel.org>2013-11-07 19:24:20 -0600
committerMichael Merickel <michael@merickel.org>2013-11-07 19:26:13 -0600
commit70381b1ac56348c025261f1e7300e0b63891d363 (patch)
treeaa7947bc69dd2878efdcf1c46d02325e4648a131
parent8f3bf659488c1a946af2cb74c7a1fd4179c350de (diff)
downloadpyramid-70381b1ac56348c025261f1e7300e0b63891d363.tar.gz
pyramid-70381b1ac56348c025261f1e7300e0b63891d363.tar.bz2
pyramid-70381b1ac56348c025261f1e7300e0b63891d363.zip
fix tests
-rw-r--r--pyramid/config/views.py4
-rw-r--r--pyramid/tests/test_url.py2
-rw-r--r--pyramid/url.py5
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: