summaryrefslogtreecommitdiff
path: root/repoze/bfg/tests/test_url.py
diff options
context:
space:
mode:
authorChris McDonough <chrism@agendaless.com>2009-12-02 14:38:18 +0000
committerChris McDonough <chrism@agendaless.com>2009-12-02 14:38:18 +0000
commitf0b74a1701e990ea8e6dda55307d6b3ff737ad45 (patch)
tree8dffdd53d16f47af5c5b8f239dac3b099bd1cf89 /repoze/bfg/tests/test_url.py
parent7fdab0a72973284b7b53888cd79d093d00e2471f (diff)
downloadpyramid-f0b74a1701e990ea8e6dda55307d6b3ff737ad45.tar.gz
pyramid-f0b74a1701e990ea8e6dda55307d6b3ff737ad45.tar.bz2
pyramid-f0b74a1701e990ea8e6dda55307d6b3ff737ad45.zip
- The ``repoze.bfg.url.route_url`` function inappropriately passed
along ``_query`` and/or ``_anchor`` arguments to the ``mapper.generate`` function, resulting in blowups.
Diffstat (limited to 'repoze/bfg/tests/test_url.py')
-rw-r--r--repoze/bfg/tests/test_url.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/repoze/bfg/tests/test_url.py b/repoze/bfg/tests/test_url.py
index 86c1cdf11..0f5050cd4 100644
--- a/repoze/bfg/tests/test_url.py
+++ b/repoze/bfg/tests/test_url.py
@@ -176,7 +176,7 @@ class TestRouteUrl(unittest.TestCase):
mapper.raise_exc = KeyError
self.assertRaises(KeyError, self._callFUT, 'flub', request, a=1)
- def test_malthe_wiggy_add_your_bug_here(self):
+ def test_generate_doesnt_receive_query_or_anchor(self):
from repoze.bfg.interfaces import IRoutesMapper
mapper = DummyRoutesMapper(result='')
from zope.component import getSiteManager
@@ -184,6 +184,7 @@ class TestRouteUrl(unittest.TestCase):
sm.registerUtility(mapper, IRoutesMapper)
request = DummyRequest()
result = self._callFUT('flub', request, _query=dict(name='some_name'))
+ self.assertEqual(mapper.kw, {}) # shouldnt have anchor/query
self.assertEqual(result, 'http://example.com:5432?name=some_name')
class TestStaticUrl(unittest.TestCase):
@@ -266,7 +267,8 @@ class DummyRoutesMapper:
def get_routes(self):
return self.routes
- def generate(self, *route_args, **newargs):
+ def generate(self, *route_args, **kw):
+ self.kw = kw
if self.raise_exc:
raise self.raise_exc
return self.result