diff options
| -rw-r--r-- | CHANGES.txt | 7 | ||||
| -rw-r--r-- | CONTRIBUTORS.txt | 2 | ||||
| -rw-r--r-- | pyramid/tests/test_url.py | 16 |
3 files changed, 22 insertions, 3 deletions
diff --git a/CHANGES.txt b/CHANGES.txt index 42b3e7546..0479e3011 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -168,13 +168,16 @@ Bug Fixes - The ``alchemy`` scaffold would break when the database was MySQL during tables creation. See https://github.com/Pylons/pyramid/pull/1049 -- The ``current_route_url`` method now attaches the query string to the URL by default. See +- The ``current_route_url`` method now attaches the query string to the URL by + default. See https://github.com/Pylons/pyramid/issues/1040 Backwards Incompatibilities --------------------------- -- Modified the ``current_route_url`` method in pyramid.Request. The method previously returned the URL without the query string by default, it now does attach the query string unless it is overriden. +- Modified the ``current_route_url`` method in pyramid.Request. The method + previously returned the URL without the query string by default, it now does + attach the query string unless it is overriden. 1.4 (2012-12-18) ================ diff --git a/CONTRIBUTORS.txt b/CONTRIBUTORS.txt index 0cecc93df..be9f36338 100644 --- a/CONTRIBUTORS.txt +++ b/CONTRIBUTORS.txt @@ -208,3 +208,5 @@ Contributors - Junaid Ali, 2013/08/10 - Chris Davies, 2013/08/11 + +- Jonathan Villemaire-Krajden, 2013/08/13 diff --git a/pyramid/tests/test_url.py b/pyramid/tests/test_url.py index 2830f8f10..9841c143e 100644 --- a/pyramid/tests/test_url.py +++ b/pyramid/tests/test_url.py @@ -499,6 +499,20 @@ class TestURLMethodsMixin(unittest.TestCase): self.assertEqual(result, 'http://example.com:5432/1/2/3?q=123') + def test_current_route_url_with_request_query_duplicate_entries(self): + from pyramid.interfaces import IRoutesMapper + from webob.multidict import GetDict + request = self._makeOne() + request.GET = GetDict([('q', '123'), ('b', '2'), ('b', '2'), ('q', '456')], {}) + route = DummyRoute('/1/2/3') + mapper = DummyRoutesMapper(route=route) + request.matched_route = route + request.matchdict = {} + request.registry.registerUtility(mapper, IRoutesMapper) + result = request.current_route_url() + self.assertEqual(result, + 'http://example.com:5432/1/2/3?q=123&b=2&b=2&q=456') + def test_current_route_url_with_query_override(self): from pyramid.interfaces import IRoutesMapper from webob.multidict import GetDict @@ -525,7 +539,7 @@ class TestURLMethodsMixin(unittest.TestCase): result = request.current_route_path('extra1', 'extra2', _query={'a':1}, _anchor=text_(b"foo")) self.assertEqual(result, '/script_name/1/2/3/extra1/extra2?a=1#foo') - + def test_route_path_with_elements(self): from pyramid.interfaces import IRoutesMapper request = self._makeOne() |
