diff options
author | Davanum Srinivas <davanum@gmail.com> | 2016-03-29 11:36:00 -0400 |
---|---|---|
committer | Davanum Srinivas <davanum@gmail.com> | 2016-03-29 15:35:41 -0400 |
commit | 21bc2ea57c5d418f37c528258ebbcf2335e009b6 (patch) | |
tree | 57fdd680824956147b0519a2d0393645320fbf28 /tests | |
parent | 3d87edf1744d0ce6da1feba3a7eddcb31a9b4de4 (diff) | |
download | routes-21bc2ea57c5d418f37c528258ebbcf2335e009b6.tar.gz |
Tolerate older usage with mandatory routename and optional path
With the following review:
https://github.com/bbangert/routes/commit/0a417004be7e2d950bdcd629ccf24cf9f56ef817
Routes 2.3 has changed the function signature to mandate
path in addition to routename for the connect method.
In this patch, we try to get back to path being optional by
checking the length of the args list. No other change in
logic.
This hopefully fixes the problem reported here:
https://github.com/bbangert/routes/issues/64
Add an entry in Changelog as well.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_functional/test_submapper.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/test_functional/test_submapper.py b/tests/test_functional/test_submapper.py index 1516a58..8821de9 100644 --- a/tests/test_functional/test_submapper.py +++ b/tests/test_functional/test_submapper.py @@ -13,6 +13,12 @@ class TestSubmapper(unittest.TestCase): eq_('/entries/1', url_for('entry', id=1))
assert_raises(Exception, url_for, 'entry', id='foo')
+ def test_submapper_with_no_path(self):
+ m = Mapper()
+ c = m.submapper(path_prefix='/')
+ c.connect('entry')
+ eq_('/entry?id=1', url_for('entry', id=1))
+
def test_submapper_nesting(self):
m = Mapper()
c = m.submapper(path_prefix='/entries', controller='entry',
|