diff options
author | Yuriy Taraday <yorik.sar@gmail.com> | 2013-11-18 15:02:34 +0400 |
---|---|---|
committer | Yuriy Taraday <yorik.sar@gmail.com> | 2013-11-18 15:02:34 +0400 |
commit | b36017431dab2f9ca9f1960f006bf8d1c2c3cb4c (patch) | |
tree | a88dd18020eadc473a39976ef1ccff1c6f94d1c4 | |
parent | 6daa9d31d98000d8cc87451cdf288624148659f9 (diff) | |
download | routes-b36017431dab2f9ca9f1960f006bf8d1c2c3cb4c.tar.gz |
Add tests for submappers' controllers fix
-rw-r--r-- | tests/test_functional/test_submapper.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/test_functional/test_submapper.py b/tests/test_functional/test_submapper.py index 2efcd94..1df97a6 100644 --- a/tests/test_functional/test_submapper.py +++ b/tests/test_functional/test_submapper.py @@ -142,6 +142,18 @@ class TestSubmapper(unittest.TestCase): eq_(True, r.conditions['sub_domain'])
eq_(requirement, r.reqs)
+ def test_subsubmapper_with_controller(self):
+ m = Mapper()
+ col1 = m.collection('parents', 'parent',
+ controller='col1',
+ member_prefix='/{parent_id}')
+ # NOTE: If one uses functions as controllers, the error will be here.
+ col2 = col1.member.collection('children', 'child',
+ controller='col2',
+ member_prefix='/{child_id}')
+ match = m.match('/parents/1/children/2')
+ eq_('col2', match.get('controller'))
+
if __name__ == '__main__':
unittest.main()
|