diff options
| author | John Anderson <sontek@gmail.com> | 2016-07-06 13:40:55 -0400 |
|---|---|---|
| committer | John Anderson <sontek@gmail.com> | 2016-07-06 13:40:55 -0400 |
| commit | 1bdb556e2122204e84429e9b1001d10367203a6c (patch) | |
| tree | 32b615e206b3e10f7e78cfd98e1ad006e4d2527a /pyramid/tests/test_scripts/test_proutes.py | |
| parent | bf91270f872594dd586d738b5aebc8b043dcad23 (diff) | |
| download | pyramid-1bdb556e2122204e84429e9b1001d10367203a6c.tar.gz pyramid-1bdb556e2122204e84429e9b1001d10367203a6c.tar.bz2 pyramid-1bdb556e2122204e84429e9b1001d10367203a6c.zip | |
This shows the correct view when a class and `attr` is involved.
Diffstat (limited to 'pyramid/tests/test_scripts/test_proutes.py')
| -rw-r--r-- | pyramid/tests/test_scripts/test_proutes.py | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/pyramid/tests/test_scripts/test_proutes.py b/pyramid/tests/test_scripts/test_proutes.py index 876572b01..aeaa57060 100644 --- a/pyramid/tests/test_scripts/test_proutes.py +++ b/pyramid/tests/test_scripts/test_proutes.py @@ -200,6 +200,33 @@ class TestPRoutesCommand(unittest.TestCase): 'pyramid.tests.test_scripts.test_proutes.view'] ) + def test_class_view(self): + from pyramid.renderers import null_renderer as nr + + config = self._makeConfig(autocommit=True) + config.add_route('foo', '/a/b') + config.add_view( + route_name='foo', + view=dummy.DummyView, + attr='view', + renderer=nr, + request_method='POST' + ) + + command = self._makeOne() + L = [] + command.out = L.append + command.bootstrap = (dummy.DummyBootstrap(registry=config.registry),) + result = command.run() + self.assertEqual(result, 0) + self.assertEqual(len(L), 3) + compare_to = L[-1].split() + expected = [ + 'foo', '/a/b', + 'pyramid.tests.test_scripts.dummy.DummyView.view', 'POST' + ] + self.assertEqual(compare_to, expected) + def test_single_route_one_view_registered_with_factory(self): from zope.interface import Interface from pyramid.interfaces import IRouteRequest |
