          expected = r"no attribute 'MISSPELLED_NAME_THAT_DOESNT_EXIST'"
          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)
 
</s> remove         expected = {'target': [u'one to one pk source with this target already exists.']}
 </s> add         expected = {'target': ['one to one pk source with this target already exists.']} </s> remove def unicode_repr(instance):
    # Get the repr of an instance, but ensure it is a unicode string
    # on both python 3 (already the case) and 2 (not the case).
    if six.PY2:
        return repr(instance).decode('utf-8')
    return repr(instance)


def unicode_to_repr(value):
    # Coerce a unicode string to the correct repr return type, depending on
    # the Python version. We wrap all our `__repr__` implementations with
    # this and then use unicode throughout internally.
    if six.PY2:
        return value.encode('utf-8')
    return value


 </s> add  </s> remove         return super(SchemaView, self).handle_exception(exc)
 </s> add         return super().handle_exception(exc) </s> remove             if isinstance(value, six.text_type):
 </s> add             if isinstance(value, str): </s> remove class BadType(object):
 </s> add class BadType:
          expected = r"no attribute 'MISSPELLED_NAME_THAT_DOESNT_EXIST'"
          with pytest.raises(WrappedAttributeError, match=expected):
              request.user
  




          with pytest.raises(WrappedAttributeError, match=expected):
              hasattr(request, 'user')
  
          with pytest.raises(WrappedAttributeError, match=expected):
              login(request, self.user)
keep keep keep keep replace replace replace replace keep keep keep keep keep
 Dropped Python 2 compatibility. (#6615)

Thanks to Jon Dufresne (@jdufresne) for review.

Co-authored-by: Asif Saif Uddin <auvipy@gmail.com>
Co-authored-by: Rizwan Mansuri <Rizwan@webbyfox.com> 
tests/test_request.py