mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-08-03 20:10:10 +03:00
Fix test for py2k
This commit is contained in:
parent
fba2a8ab0f
commit
ebd1e85678
|
@ -230,6 +230,13 @@ class TestUserSetter(TestCase):
|
|||
with pytest.raises(WrappedAttributeError, match=expected):
|
||||
request.user
|
||||
|
||||
# python 2 hasattr fails for *any* exception, not just AttributeError
|
||||
if six.PY2:
|
||||
return
|
||||
|
||||
with pytest.raises(WrappedAttributeError, match=expected):
|
||||
hasattr(request, 'user')
|
||||
|
||||
with pytest.raises(WrappedAttributeError, match=expected):
|
||||
login(request, self.user)
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user