Skip to content

Commit ebd1e85

Browse files
author
Ryan P Kilby
committed
Fix test for py2k
1 parent fba2a8a commit ebd1e85

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

tests/test_request.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,13 @@ def authenticate(self, request):
230230
with pytest.raises(WrappedAttributeError, match=expected):
231231
request.user
232232

233+
# python 2 hasattr fails for *any* exception, not just AttributeError
234+
if six.PY2:
235+
return
236+
237+
with pytest.raises(WrappedAttributeError, match=expected):
238+
hasattr(request, 'user')
239+
233240
with pytest.raises(WrappedAttributeError, match=expected):
234241
login(request, self.user)
235242

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy