summaryrefslogtreecommitdiff
path: root/tests/test_security.py
diff options
context:
space:
mode:
authorTheron Luhn <theron@luhn.com>2019-12-14 18:45:21 -0600
committerTheron Luhn <theron@luhn.com>2019-12-14 18:45:21 -0600
commit0f1ef0d4885ab2fd99d1cf2ccc92886c5519f651 (patch)
treee22e97eab1855a50dcdf925e0d4d20a064d74f5f /tests/test_security.py
parenta7692dbc47a86c8fbf763d095bf567d7e28ab3ff (diff)
downloadpyramid-0f1ef0d4885ab2fd99d1cf2ccc92886c5519f651.tar.gz
pyramid-0f1ef0d4885ab2fd99d1cf2ccc92886c5519f651.tar.bz2
pyramid-0f1ef0d4885ab2fd99d1cf2ccc92886c5519f651.zip
Remove failing tests using threadlocal request.
It shoud be okay to remove because threadlocal support was removed from the security implementation. However, *I don't understand why they started failing.* In master, `get_current_registry` returns a registry object, which DummyRequest will fall back on, causing the tests to pass and rendering them useless. On this branch, it returns `None`, causing the tests to fail. I can't find any reason in the diff why this would change. This makes me nervous.
Diffstat (limited to 'tests/test_security.py')
-rw-r--r--tests/test_security.py36
1 files changed, 0 insertions, 36 deletions
diff --git a/tests/test_security.py b/tests/test_security.py
index 726fbbbf3..ca28ec190 100644
--- a/tests/test_security.py
+++ b/tests/test_security.py
@@ -165,15 +165,6 @@ class TestPrincipalsAllowedByPermission(unittest.TestCase):
result = self._callFUT(context, 'view')
self.assertEqual(result, [Everyone])
- def test_with_authorization_policy(self):
- from pyramid.threadlocal import get_current_registry
-
- registry = get_current_registry()
- _registerAuthorizationPolicy(registry, 'yo')
- context = DummyContext()
- result = self._callFUT(context, 'view')
- self.assertEqual(result, 'yo')
-
class TestRemember(unittest.TestCase):
def setUp(self):
@@ -358,15 +349,6 @@ class TestAuthenticatedUserId(unittest.TestCase):
_registerSecurityPolicy(request.registry, 123)
self.assertEqual(request.authenticated_userid, '123')
- def test_with_authentication_policy_no_reg_on_request(self):
- from pyramid.threadlocal import get_current_registry
-
- registry = get_current_registry()
- request = _makeRequest()
- del request.registry
- _registerAuthenticationPolicy(registry, 'yo')
- self.assertEqual(request.authenticated_userid, 'yo')
-
class TestUnAuthenticatedUserId(unittest.TestCase):
def setUp(self):
@@ -390,15 +372,6 @@ class TestUnAuthenticatedUserId(unittest.TestCase):
_registerSecurityPolicy(request.registry, 'yo')
self.assertEqual(request.unauthenticated_userid, 'yo')
- def test_with_authentication_policy_no_reg_on_request(self):
- from pyramid.threadlocal import get_current_registry
-
- registry = get_current_registry()
- request = _makeRequest()
- del request.registry
- _registerAuthenticationPolicy(registry, 'yo')
- self.assertEqual(request.unauthenticated_userid, 'yo')
-
class TestEffectivePrincipals(unittest.TestCase):
def setUp(self):
@@ -418,15 +391,6 @@ class TestEffectivePrincipals(unittest.TestCase):
_registerAuthenticationPolicy(request.registry, 'yo')
self.assertEqual(request.effective_principals, 'yo')
- def test_with_authentication_policy_no_reg_on_request(self):
- from pyramid.threadlocal import get_current_registry
-
- registry = get_current_registry()
- request = _makeRequest()
- del request.registry
- _registerAuthenticationPolicy(registry, 'yo')
- self.assertEqual(request.effective_principals, 'yo')
-
class TestHasPermission(unittest.TestCase):
def setUp(self):