diff options
| author | Chris McDonough <chrism@plope.com> | 2012-01-06 04:15:21 -0500 |
|---|---|---|
| committer | Chris McDonough <chrism@plope.com> | 2012-01-06 04:15:21 -0500 |
| commit | 3c59ce5e5b99d652938ef5111091ce8e2516b4d1 (patch) | |
| tree | ef41d492bb78eeca354e77d5e9168f19a8db87dc | |
| parent | 4c29ef5be6e7bb1418ce896a92f4c8bd6d9a3111 (diff) | |
| download | pyramid-3c59ce5e5b99d652938ef5111091ce8e2516b4d1.tar.gz pyramid-3c59ce5e5b99d652938ef5111091ce8e2516b4d1.tar.bz2 pyramid-3c59ce5e5b99d652938ef5111091ce8e2516b4d1.zip | |
add tests for different kinds of names
| -rw-r--r-- | pyramid/tests/test_config/test_views.py | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/pyramid/tests/test_config/test_views.py b/pyramid/tests/test_config/test_views.py index 6563fe772..fdf82e7d8 100644 --- a/pyramid/tests/test_config/test_views.py +++ b/pyramid/tests/test_config/test_views.py @@ -5,7 +5,10 @@ from pyramid.tests.test_config import IDummy from pyramid.tests.test_config import dummy_view -from pyramid.compat import im_func +from pyramid.compat import ( + im_func, + text_, + ) from pyramid.exceptions import ConfigurationError from pyramid.exceptions import ConfigurationExecutionError from pyramid.exceptions import ConfigurationConflictError @@ -144,6 +147,25 @@ class TestViewsConfigurationMixin(unittest.TestCase): result = wrapper(None, None) self.assertEqual(result, 'OK') + def test_add_view_with_name(self): + from pyramid.renderers import null_renderer + view = lambda *arg: 'OK' + config = self._makeOne(autocommit=True) + config.add_view(view=view, name='abc', renderer=null_renderer) + wrapper = self._getViewCallable(config, name='abc') + result = wrapper(None, None) + self.assertEqual(result, 'OK') + + def test_add_view_with_name_unicode(self): + from pyramid.renderers import null_renderer + view = lambda *arg: 'OK' + config = self._makeOne(autocommit=True) + name = text_(b'La Pe\xc3\xb1a', 'utf-8') + config.add_view(view=view, name=name, renderer=null_renderer) + wrapper = self._getViewCallable(config, name=name) + result = wrapper(None, None) + self.assertEqual(result, 'OK') + def test_add_view_with_decorator(self): from pyramid.renderers import null_renderer def view(request): |
