diff options
| author | Theron Luhn <theron@luhn.com> | 2019-05-12 10:55:01 -0700 |
|---|---|---|
| committer | Theron Luhn <theron@luhn.com> | 2019-05-12 10:55:01 -0700 |
| commit | 08d5eddb2932a894fac03917508da95f480bfe7d (patch) | |
| tree | 77e25e830e3e33a45b4b3608585a0c40d4081a46 | |
| parent | ad611d2696701b611d2ef9dfe93567ecf6cb338d (diff) | |
| download | pyramid-08d5eddb2932a894fac03917508da95f480bfe7d.tar.gz pyramid-08d5eddb2932a894fac03917508da95f480bfe7d.tar.bz2 pyramid-08d5eddb2932a894fac03917508da95f480bfe7d.zip | |
Rename request.identity to request.authenticated_identity.
| -rw-r--r-- | src/pyramid/security.py | 2 | ||||
| -rw-r--r-- | tests/test_security.py | 6 |
2 files changed, 4 insertions, 4 deletions
diff --git a/src/pyramid/security.py b/src/pyramid/security.py index 5d8e916d7..fd05746bd 100644 --- a/src/pyramid/security.py +++ b/src/pyramid/security.py @@ -279,7 +279,7 @@ class ACLAllowed(ACLPermitsResult, Allowed): class SecurityAPIMixin(object): @property - def identity(self): + def authenticated_identity(self): """ Return an opaque object identifying the current user or ``None`` if no user is authenticated or there is no :term:`security policy` in effect. diff --git a/tests/test_security.py b/tests/test_security.py index 5a0307c66..2a8847f3b 100644 --- a/tests/test_security.py +++ b/tests/test_security.py @@ -318,7 +318,7 @@ class TestViewExecutionPermitted(unittest.TestCase): self.assertTrue(result) -class TestIdentity(unittest.TestCase): +class TestAuthenticatedIdentity(unittest.TestCase): def setUp(self): testing.setUp() @@ -327,12 +327,12 @@ class TestIdentity(unittest.TestCase): def test_identity_no_security_policy(self): request = _makeRequest() - self.assertEquals(request.identity, None) + self.assertEquals(request.authenticated_identity, None) def test_identity(self): request = _makeRequest() _registerSecurityPolicy(request.registry, 'yo') - self.assertEqual(request.identity, 'yo') + self.assertEqual(request.authenticated_identity, 'yo') class TestAuthenticatedUserId(unittest.TestCase): |
