Fix test for py2k

This commit is contained in:
Ryan P Kilby 2017-11-15 20:06:35 -05:00
parent fba2a8ab0f
commit ebd1e85678

View File

@ -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)