diff options
| -rw-r--r-- | CHANGES.txt | 4 | ||||
| -rw-r--r-- | docs/api/view.rst | 2 | ||||
| -rw-r--r-- | pyramid/tests/test_view.py | 45 | ||||
| -rw-r--r-- | pyramid/view.py | 17 |
4 files changed, 4 insertions, 64 deletions
diff --git a/CHANGES.txt b/CHANGES.txt index 42ba8b3ce..989d1bca1 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -77,6 +77,10 @@ Backwards Incompatibilities since Pyramid 1.1. Instead use ``pyramid.static.static_view`` with ``use_subpath=True`` argument. +- Removed the ``pyramid.view.is_response`` function that had been deprecated + since Pyramid 1.1. Use the ``pyramid.request.Request.is_response`` method + instead. + 1.5a1 (2013-08-30) ================== diff --git a/docs/api/view.rst b/docs/api/view.rst index e79e1b505..d8e429552 100644 --- a/docs/api/view.rst +++ b/docs/api/view.rst @@ -11,8 +11,6 @@ .. autofunction:: render_view - .. autofunction:: is_response - .. autoclass:: view_config :members: diff --git a/pyramid/tests/test_view.py b/pyramid/tests/test_view.py index bd7e635dd..309fd47e2 100644 --- a/pyramid/tests/test_view.py +++ b/pyramid/tests/test_view.py @@ -301,51 +301,6 @@ class RenderViewTests(BaseTest, unittest.TestCase): s = self._callFUT(context, request, name='registered', secure=False) self.assertEqual(s, b'anotherview') -class TestIsResponse(unittest.TestCase): - def setUp(self): - from zope.deprecation import __show__ - __show__.off() - - def tearDown(self): - from zope.deprecation import __show__ - __show__.on() - - def _callFUT(self, *arg, **kw): - from pyramid.view import is_response - return is_response(*arg, **kw) - - def test_is(self): - response = DummyResponse() - self.assertEqual(self._callFUT(response), True) - - def test_isnt(self): - response = None - self.assertEqual(self._callFUT(response), False) - - def test_isnt_no_headerlist(self): - class Response(object): - pass - resp = Response - resp.status = '200 OK' - resp.app_iter = [] - self.assertEqual(self._callFUT(resp), False) - - def test_isnt_no_status(self): - class Response(object): - pass - resp = Response - resp.app_iter = [] - resp.headerlist = () - self.assertEqual(self._callFUT(resp), False) - - def test_isnt_no_app_iter(self): - class Response(object): - pass - resp = Response - resp.status = '200 OK' - resp.headerlist = () - self.assertEqual(self._callFUT(resp), False) - class TestViewConfigDecorator(unittest.TestCase): def setUp(self): testing.setUp() diff --git a/pyramid/view.py b/pyramid/view.py index 1ef8faab3..edb4d688c 100644 --- a/pyramid/view.py +++ b/pyramid/view.py @@ -1,8 +1,6 @@ import venusian from zope.interface import providedBy -from zope.deprecation import deprecated - from pyramid.interfaces import ( IRoutesMapper, @@ -407,18 +405,3 @@ class forbidden_view_config(object): settings['_info'] = info.codeinfo # fbo "action_method" return wrapped -def is_response(ob): - """ Return ``True`` if ``ob`` implements the interface implied by - :ref:`the_response`. ``False`` if not. - - .. deprecated:: 1.1 - use :func:`pyramid.request.Request.is_response` instead""" - if ( hasattr(ob, 'app_iter') and hasattr(ob, 'headerlist') and - hasattr(ob, 'status') ): - return True - return False - -deprecated( - 'is_response', - 'pyramid.view.is_response is deprecated as of Pyramid 1.1. Use ' - 'pyramid.request.Request.is_response instead.') |
