Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitebd1e85

Browse files
author
Ryan P Kilby
committed
Fix test for py2k
1 parentfba2a8a commitebd1e85

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
withpytest.raises(WrappedAttributeError,match=expected):
231231
request.user
232232

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

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp