diff options
| author | Michael Merickel <michael@merickel.org> | 2018-10-03 20:35:22 -0500 |
|---|---|---|
| committer | Michael Merickel <michael@merickel.org> | 2018-11-01 10:05:47 -0500 |
| commit | f229f02f7c96ba81f1827973458fd0c5843235f1 (patch) | |
| tree | 5f489b644f1571aef94bb61e9baee0bab9407a74 /tests/test_security.py | |
| parent | 04eff2cc3ab71f0c38583647b047fff9447b7668 (diff) | |
| download | pyramid-f229f02f7c96ba81f1827973458fd0c5843235f1.tar.gz pyramid-f229f02f7c96ba81f1827973458fd0c5843235f1.tar.bz2 pyramid-f229f02f7c96ba81f1827973458fd0c5843235f1.zip | |
remove deprecated security functions
Diffstat (limited to 'tests/test_security.py')
| -rw-r--r-- | tests/test_security.py | 78 |
1 files changed, 0 insertions, 78 deletions
diff --git a/tests/test_security.py b/tests/test_security.py index a11035d85..8b8028f61 100644 --- a/tests/test_security.py +++ b/tests/test_security.py @@ -345,20 +345,6 @@ class TestAuthenticatedUserId(unittest.TestCase): def tearDown(self): testing.tearDown() - def test_backward_compat_delegates_to_mixin(self): - from zope.deprecation import __show__ - - try: - __show__.off() - request = _makeFakeRequest() - from pyramid.security import authenticated_userid - - self.assertEqual( - authenticated_userid(request), 'authenticated_userid' - ) - finally: - __show__.on() - def test_no_authentication_policy(self): request = _makeRequest() self.assertEqual(request.authenticated_userid, None) @@ -385,20 +371,6 @@ class TestUnAuthenticatedUserId(unittest.TestCase): def tearDown(self): testing.tearDown() - def test_backward_compat_delegates_to_mixin(self): - from zope.deprecation import __show__ - - try: - __show__.off() - request = _makeFakeRequest() - from pyramid.security import unauthenticated_userid - - self.assertEqual( - unauthenticated_userid(request), 'unauthenticated_userid' - ) - finally: - __show__.on() - def test_no_authentication_policy(self): request = _makeRequest() self.assertEqual(request.unauthenticated_userid, None) @@ -425,20 +397,6 @@ class TestEffectivePrincipals(unittest.TestCase): def tearDown(self): testing.tearDown() - def test_backward_compat_delegates_to_mixin(self): - request = _makeFakeRequest() - from zope.deprecation import __show__ - - try: - __show__.off() - from pyramid.security import effective_principals - - self.assertEqual( - effective_principals(request), 'effective_principals' - ) - finally: - __show__.on() - def test_no_authentication_policy(self): from pyramid.security import Everyone @@ -476,25 +434,6 @@ class TestHasPermission(unittest.TestCase): mixin.context = object() return mixin - def test_delegates_to_mixin(self): - from zope.deprecation import __show__ - - try: - __show__.off() - mixin = self._makeOne() - from pyramid.security import has_permission - - self.called_has_permission = False - - def mocked_has_permission(*args, **kw): - self.called_has_permission = True - - mixin.has_permission = mocked_has_permission - has_permission('view', object(), mixin) - self.assertTrue(self.called_has_permission) - finally: - __show__.on() - def test_no_authentication_policy(self): request = self._makeOne() result = request.has_permission('view') @@ -600,20 +539,3 @@ def _makeRequest(): request.registry = Registry() request.context = object() return request - - -def _makeFakeRequest(): - class FakeRequest(testing.DummyRequest): - @property - def authenticated_userid(req): - return 'authenticated_userid' - - @property - def unauthenticated_userid(req): - return 'unauthenticated_userid' - - @property - def effective_principals(req): - return 'effective_principals' - - return FakeRequest({}) |
