Permalink
Browse files

Fixed documentation width, signed contributors agreement and added a …

…test for duplicate query strings.
  • Loading branch information...
odontomachus committed Aug 13, 2013
1 parent 33e0fe1 commit 6a4a3413756a94f5e7ebbe7720788f28ca280a72
Showing with 22 additions and 3 deletions.
  1. +5 −2 CHANGES.txt
  2. +2 −0 CONTRIBUTORS.txt
  3. +15 −1 pyramid/tests/test_url.py
View
@@ -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)
================
View
@@ -208,3 +208,5 @@ Contributors
- Junaid Ali, 2013/08/10
- Chris Davies, 2013/08/11
+
+- Jonathan Villemaire-Krajden, 2013/08/13
View
@@ -499,6 +499,20 @@ def test_current_route_url_with_request_query(self):
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 @@ def test_current_route_path(self):
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()

0 comments on commit 6a4a341

Please sign in to comment.