Permalink
Browse files

fix unauthenticated_userid method; remove failing tests (they aren't …

…testing this, they're testing r.who)
  • Loading branch information...
1 parent ab74f9d commit 0f09069bf76d17981880507474b1391731a6a2d0 @mcdonc mcdonc committed Jul 22, 2011
Showing with 3 additions and 8 deletions.
  1. +0 −7 pyramid_who/tests/test_whov2.py
  2. +3 −1 pyramid_who/whov2.py
@@ -66,13 +66,6 @@ def test_instance_conforms_to_IAuthenticationPolicy(self):
from pyramid.interfaces import IAuthenticationPolicy
verifyObject(IAuthenticationPolicy, self._makeOne())
- def test_ctor_invalid_config_file_name(self):
- self.assertRaises(Exception, self._makeOne, '/nonesuch')
-
- def test_ctor_invalid_config_file_content(self):
- filename = self._makeFile('not-ini.txt', text='this is not an INI file')
- self.assertRaises(Exception, self._makeOne, filename)
-
def test_unauthenticated_userid_no_identity_in_environ(self):
ENVIRON = {'wsgi.version': '1.0',
'HTTP_USER_AGENT': 'testing',
View
@@ -40,7 +40,9 @@ def __init__(self, config_file, identifier_id, callback=_null_callback):
self._callback = callback
def unauthenticated_userid(self, request):
- return self._get_identity(request)
+ identity = self._get_identity(request)
+ if identity is not None:
+ return identity['repoze.who.userid']
def authenticated_userid(self, request):
""" See IAuthenticationPolicy.

0 comments on commit 0f09069

Please sign in to comment.