diff options
| author | Chris McDonough <chrism@agendaless.com> | 2010-01-24 08:45:35 +0000 |
|---|---|---|
| committer | Chris McDonough <chrism@agendaless.com> | 2010-01-24 08:45:35 +0000 |
| commit | 333bd06861e55f97dfcaeebff100657734829add (patch) | |
| tree | 495b62d5b297a52f29f042adca5d54a319d413c2 /repoze/bfg/tests/test_integration.py | |
| parent | cc6a44df0a8535d2bc91944ae34a2521c12c7a07 (diff) | |
| download | pyramid-333bd06861e55f97dfcaeebff100657734829add.tar.gz pyramid-333bd06861e55f97dfcaeebff100657734829add.tar.bz2 pyramid-333bd06861e55f97dfcaeebff100657734829add.zip | |
Merge reversepolarity branch.
Diffstat (limited to 'repoze/bfg/tests/test_integration.py')
| -rw-r--r-- | repoze/bfg/tests/test_integration.py | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/repoze/bfg/tests/test_integration.py b/repoze/bfg/tests/test_integration.py index 1c6fdd01e..6affe24e1 100644 --- a/repoze/bfg/tests/test_integration.py +++ b/repoze/bfg/tests/test_integration.py @@ -36,7 +36,7 @@ class WGSIAppPlusBFGViewTests(unittest.TestCase): config = Configurator() config.scan(test_integration) reg = config.registry - view = reg.adapters.lookup((INothing, IRequest), IView, name='') + view = reg.adapters.lookup((IRequest, INothing), IView, name='') self.assertEqual(view, wsgiapptest) here = os.path.dirname(__file__) @@ -113,6 +113,29 @@ class TestCCBug(TwillBase): self.assertEqual(browser.get_code(), 200) self.assertEqual(browser.get_html(), 'juri') +class TestHybridApp(TwillBase): + # make sure views registered for a route "win" over views registered + # without one, even though the context of the non-route view may + # be more specific than the route view. + config = 'repoze.bfg.tests.hybridapp:configure.zcml' + def test_it(self): + import twill.commands + browser = twill.commands.get_browser() + browser.go('http://localhost:6543/') + self.assertEqual(browser.get_code(), 200) + self.assertEqual(browser.get_html(), 'global') + browser.go('http://localhost:6543/abc') + self.assertEqual(browser.get_code(), 200) + self.assertEqual(browser.get_html(), 'route') + browser.go('http://localhost:6543/def') + self.assertEqual(browser.get_code(), 200) + self.assertEqual(browser.get_html(), 'route2') + browser.go('http://localhost:6543/ghi') + self.assertEqual(browser.get_code(), 200) + self.assertEqual(browser.get_html(), 'global') + browser.go('http://localhost:6543/jkl') + self.assertEqual(browser.get_code(), 404) + class DummyContext(object): pass |
