summaryrefslogtreecommitdiff
path: root/repoze/bfg/tests/test_view.py
diff options
context:
space:
mode:
authorChris McDonough <chrism@agendaless.com>2009-09-30 03:27:28 +0000
committerChris McDonough <chrism@agendaless.com>2009-09-30 03:27:28 +0000
commitd75fe70228c89e3606e51a4d5775faf549252a90 (patch)
tree043a7334d49a7455b80789f1aab56e4238dbd6b0 /repoze/bfg/tests/test_view.py
parent4be6ce73f41e09bf0f3e5df01d7f5aaf4f3137a6 (diff)
downloadpyramid-d75fe70228c89e3606e51a4d5775faf549252a90.tar.gz
pyramid-d75fe70228c89e3606e51a4d5775faf549252a90.tar.bz2
pyramid-d75fe70228c89e3606e51a4d5775faf549252a90.zip
- The import of ``repoze.bfg.view.NotFound`` is deprecated in favor of
``repoze.bfg.exceptions.NotFound``. The old location still functions, but emits a deprecation warning. - The import of ``repoze.bfg.security.Unauthorized`` is deprecated in favor of ``repoze.bfg.exceptions.Forbidden``. The old location still functions but emits a deprecation warning. The rename from ``Unauthorized`` to ``Forbidden`` brings parity to the the name of the exception and the system view it invokes when raised. - New ``repoze.bfg.exceptions`` module was created to house exceptions that were previously sprinkled through various modules. - An ``exceptions`` API chapter was added, documenting the new ``repoze.bfg.exceptions`` module.
Diffstat (limited to 'repoze/bfg/tests/test_view.py')
-rw-r--r--repoze/bfg/tests/test_view.py18
1 files changed, 9 insertions, 9 deletions
diff --git a/repoze/bfg/tests/test_view.py b/repoze/bfg/tests/test_view.py
index edbfa120f..32c9d391b 100644
--- a/repoze/bfg/tests/test_view.py
+++ b/repoze/bfg/tests/test_view.py
@@ -467,14 +467,14 @@ class TestMultiView(unittest.TestCase):
self.assertEqual(mv.views, [(99, 'view2'), (100, 'view')])
def test_match_not_found(self):
- from repoze.bfg.view import NotFound
+ from repoze.bfg.exceptions import NotFound
mv = self._makeOne()
context = DummyContext()
request = DummyRequest()
self.assertRaises(NotFound, mv.match, context, request)
def test_match_predicate_fails(self):
- from repoze.bfg.view import NotFound
+ from repoze.bfg.exceptions import NotFound
mv = self._makeOne()
def view(context, request):
""" """
@@ -496,7 +496,7 @@ class TestMultiView(unittest.TestCase):
self.assertEqual(result, view)
def test_permitted_no_views(self):
- from repoze.bfg.view import NotFound
+ from repoze.bfg.exceptions import NotFound
mv = self._makeOne()
context = DummyContext()
request = DummyRequest()
@@ -527,14 +527,14 @@ class TestMultiView(unittest.TestCase):
self.assertEqual(result, False)
def test__call__not_found(self):
- from repoze.bfg.view import NotFound
+ from repoze.bfg.exceptions import NotFound
mv = self._makeOne()
context = DummyContext()
request = DummyRequest()
self.assertRaises(NotFound, mv, context, request)
def test___call__intermediate_not_found(self):
- from repoze.bfg.view import NotFound
+ from repoze.bfg.exceptions import NotFound
mv = self._makeOne()
context = DummyContext()
request = DummyRequest()
@@ -561,7 +561,7 @@ class TestMultiView(unittest.TestCase):
self.assertEqual(response, expected_response)
def test__call_permissive__not_found(self):
- from repoze.bfg.view import NotFound
+ from repoze.bfg.exceptions import NotFound
mv = self._makeOne()
context = DummyContext()
request = DummyRequest()
@@ -1408,7 +1408,7 @@ class TestDeriveView(unittest.TestCase):
"'view_name' against context None): True")
def test_view_with_debug_authorization_permission_authpol_denied(self):
- from repoze.bfg.security import Unauthorized
+ from repoze.bfg.exceptions import Forbidden
def view(context, request):
""" """
self._registerSettings(debug_authorization=True, reload_templates=True)
@@ -1422,7 +1422,7 @@ class TestDeriveView(unittest.TestCase):
request = DummyRequest()
request.view_name = 'view_name'
request.url = 'url'
- self.assertRaises(Unauthorized, result, None, request)
+ self.assertRaises(Forbidden, result, None, request)
self.assertEqual(len(logger.messages), 1)
self.assertEqual(logger.messages[0],
"debug_authorization of url url (view name "
@@ -1462,7 +1462,7 @@ class TestDeriveView(unittest.TestCase):
self.assertEqual(predicates, [True, True])
def test_view_with_predicates_notall(self):
- from repoze.bfg.view import NotFound
+ from repoze.bfg.exceptions import NotFound
def view(context, request):
""" """
predicates = []