From 21bc2ea57c5d418f37c528258ebbcf2335e009b6 Mon Sep 17 00:00:00 2001 From: Davanum Srinivas Date: Tue, 29 Mar 2016 11:36:00 -0400 Subject: 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. --- tests/test_functional/test_submapper.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'tests') 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', -- cgit v1.2.1