From 0f1ef0d4885ab2fd99d1cf2ccc92886c5519f651 Mon Sep 17 00:00:00 2001 From: Theron Luhn Date: Sat, 14 Dec 2019 18:45:21 -0600 Subject: 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. --- tests/test_security.py | 36 ------------------------------------ 1 file changed, 36 deletions(-) (limited to 'tests/test_security.py') 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): -- cgit v1.2.3