diff options
| -rw-r--r-- | CHANGES.rst | 4 | ||||
| -rw-r--r-- | TODO.txt | 1 | ||||
| -rw-r--r-- | docs/api/config.rst | 1 | ||||
| -rw-r--r-- | docs/api/request.rst | 3 | ||||
| -rw-r--r-- | docs/narr/advconfig.rst | 1 | ||||
| -rw-r--r-- | docs/narr/subrequest.rst | 3 | ||||
| -rw-r--r-- | pyramid/config/factories.py | 20 | ||||
| -rw-r--r-- | pyramid/tests/test_config/test_factories.py | 60 |
8 files changed, 6 insertions, 87 deletions
diff --git a/CHANGES.rst b/CHANGES.rst index 926584de0..2b08965d1 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -131,6 +131,10 @@ Backward Incompatibilities of previous ``pyramid.httpexceptions.HTTPFound``. See https://github.com/Pylons/pyramid/pull/3328 +- Removed ``pyramid.config.Configurator.set_request_property`` which had been + deprecated since Pyramid 1.5. + See https://github.com/Pylons/pyramid/pull/3368 + Documentation Changes --------------------- @@ -114,7 +114,6 @@ Nice-to-Have Future ------ -- 1.9: Remove set_request_property. - 1.9: Remove extra code enabling ``pyramid.security.remember(principal=...)`` and force use of ``userid``. diff --git a/docs/api/config.rst b/docs/api/config.rst index a785b64ad..b2cd53a68 100644 --- a/docs/api/config.rst +++ b/docs/api/config.rst @@ -44,7 +44,6 @@ :methodcategory:`Extending the Request Object` .. automethod:: add_request_method - .. automethod:: set_request_property :methodcategory:`Using I18N` diff --git a/docs/api/request.rst b/docs/api/request.rst index b5700f4ab..0c169adaf 100644 --- a/docs/api/request.rst +++ b/docs/api/request.rst @@ -228,8 +228,7 @@ handed. - sets request extensions (such as those added via - :meth:`~pyramid.config.Configurator.add_request_method` or - :meth:`~pyramid.config.Configurator.set_request_property`) on the + :meth:`~pyramid.config.Configurator.add_request_method`) on the request it's passed. - causes a :class:`~pyramid.events.NewRequest` event to be sent at the diff --git a/docs/narr/advconfig.rst b/docs/narr/advconfig.rst index 880e538f1..322741648 100644 --- a/docs/narr/advconfig.rst +++ b/docs/narr/advconfig.rst @@ -299,7 +299,6 @@ These are the methods of the configurator which provide conflict detection: :meth:`~pyramid.config.Configurator.add_request_method`, :meth:`~pyramid.config.Configurator.set_request_factory`, :meth:`~pyramid.config.Configurator.set_session_factory`, -:meth:`~pyramid.config.Configurator.set_request_property`, :meth:`~pyramid.config.Configurator.set_root_factory`, :meth:`~pyramid.config.Configurator.set_view_mapper`, :meth:`~pyramid.config.Configurator.set_authentication_policy`, diff --git a/docs/narr/subrequest.rst b/docs/narr/subrequest.rst index 9094c7d83..03f372446 100644 --- a/docs/narr/subrequest.rst +++ b/docs/narr/subrequest.rst @@ -232,8 +232,7 @@ unconditionally does the following: callable) to the request object to which it is handed. - It sets request extensions (such as those added via - :meth:`~pyramid.config.Configurator.add_request_method` or - :meth:`~pyramid.config.Configurator.set_request_property`) on the subrequest + :meth:`~pyramid.config.Configurator.add_request_method`) on the subrequest object passed as ``request``. - It causes a :class:`~pyramid.events.NewRequest` event to be sent at the diff --git a/pyramid/config/factories.py b/pyramid/config/factories.py index 7a5b589cf..52248269d 100644 --- a/pyramid/config/factories.py +++ b/pyramid/config/factories.py @@ -1,4 +1,3 @@ -from zope.deprecation import deprecated from zope.interface import implementer from pyramid.interfaces import ( @@ -216,25 +215,6 @@ class FactoriesConfiguratorMixin(object): introspectables=(intr,)) @action_method - def set_request_property(self, callable, name=None, reify=False): - """ Add a property to the request object. - - .. deprecated:: 1.5 - :meth:`pyramid.config.Configurator.add_request_method` should be - used instead. (This method was docs-deprecated in 1.4 and - issues a real deprecation warning in 1.5). - - .. versionadded:: 1.3 - """ - self.add_request_method( - callable, name=name, property=not reify, reify=reify) - - deprecated( - set_request_property, - 'set_request_propery() is deprecated as of Pyramid 1.5; use ' - 'add_request_method() with the property=True argument instead') - - @action_method def set_execution_policy(self, policy): """ Override the :app:`Pyramid` :term:`execution policy` in the diff --git a/pyramid/tests/test_config/test_factories.py b/pyramid/tests/test_config/test_factories.py index eb1f3534c..7e6ea0476 100644 --- a/pyramid/tests/test_config/test_factories.py +++ b/pyramid/tests/test_config/test_factories.py @@ -161,63 +161,3 @@ class TestFactoriesMixin(unittest.TestCase): registry = config.registry result = registry.queryUtility(IExecutionPolicy) self.assertEqual(result, default_execution_policy) - -class TestDeprecatedFactoriesMixinMethods(unittest.TestCase): - def setUp(self): - from zope.deprecation import __show__ - __show__.off() - - def tearDown(self): - from zope.deprecation import __show__ - __show__.on() - - def _makeOne(self, *arg, **kw): - from pyramid.config import Configurator - config = Configurator(*arg, **kw) - return config - - def test_set_request_property_with_callable(self): - from pyramid.interfaces import IRequestExtensions - config = self._makeOne(autocommit=True) - callable = lambda x: None - config.set_request_property(callable, name='foo') - exts = config.registry.getUtility(IRequestExtensions) - self.assertTrue('foo' in exts.descriptors) - - def test_set_request_property_with_unnamed_callable(self): - from pyramid.interfaces import IRequestExtensions - config = self._makeOne(autocommit=True) - def foo(self): pass - config.set_request_property(foo, reify=True) - exts = config.registry.getUtility(IRequestExtensions) - self.assertTrue('foo' in exts.descriptors) - - def test_set_request_property_with_property(self): - from pyramid.interfaces import IRequestExtensions - config = self._makeOne(autocommit=True) - callable = property(lambda x: None) - config.set_request_property(callable, name='foo') - exts = config.registry.getUtility(IRequestExtensions) - self.assertTrue('foo' in exts.descriptors) - - def test_set_multiple_request_properties(self): - from pyramid.interfaces import IRequestExtensions - config = self._makeOne() - def foo(self): pass - bar = property(lambda x: None) - config.set_request_property(foo, reify=True) - config.set_request_property(bar, name='bar') - config.commit() - exts = config.registry.getUtility(IRequestExtensions) - self.assertTrue('foo' in exts.descriptors) - self.assertTrue('bar' in exts.descriptors) - - def test_set_multiple_request_properties_conflict(self): - from pyramid.exceptions import ConfigurationConflictError - config = self._makeOne() - def foo(self): pass - bar = property(lambda x: None) - config.set_request_property(foo, name='bar', reify=True) - config.set_request_property(bar, name='bar') - self.assertRaises(ConfigurationConflictError, config.commit) - |
