Permalink
Browse files

- Removed the ``pyramid.view.is_response`` function that had been dep…

…recated

  since Pyramid 1.1.  Use the ``pyramid.request.Request.is_response`` method
  instead.
  • Loading branch information...
1 parent 2c4f4e3 commit 780bbf9998fd805df55499ef4a78f41cbf99c7de @mcdonc mcdonc committed Sep 9, 2013
Showing with 4 additions and 64 deletions.
  1. +4 −0 CHANGES.txt
  2. +0 −2 docs/api/view.rst
  3. +0 −45 pyramid/tests/test_view.py
  4. +0 −17 pyramid/view.py
View
4 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)
==================
View
2 docs/api/view.rst
@@ -11,8 +11,6 @@
.. autofunction:: render_view
- .. autofunction:: is_response
-
.. autoclass:: view_config
:members:
View
45 pyramid/tests/test_view.py
@@ -301,51 +301,6 @@ def anotherview(context, request):
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()
View
17 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 @@ def callback(context, name, ob):
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.')

0 comments on commit 780bbf9

Please sign in to comment.