          serializer = ValidationSerializer(data='invalid data')
          assert not serializer.is_valid()
          assert serializer.errors == {
              'non_field_errors': [
                  'Invalid data. Expected a dictionary, but got %s.' % six.text_type.__name__
              ]
          }
  
  
  # regression tests for issue: 1493
 
</s> remove         text_type_string = six.text_type.__name__
        message = 'Invalid data. Expected a dictionary, but got %s.' % text_type_string
 </s> add         message = 'Invalid data. Expected a dictionary, but got str.' </s> remove @six.add_metaclass(SerializerMetaclass)
class Serializer(BaseSerializer):
 </s> add class Serializer(BaseSerializer, metaclass=SerializerMetaclass): </s> remove         assert serializer.errors == {'target': ['Incorrect type. Expected pk value, received %s.' % six.text_type.__name__]}
 </s> add         assert serializer.errors == {'target': ['Incorrect type. Expected pk value, received str.']} </s> remove     @unittest.skipUnless(ChainMap, 'requires python 3.3')
 </s> add  </s> remove         assert field.run_validation(1) is 1
 </s> add         assert field.run_validation(1) == 1
                'Invalid data. Expected a dictionary, but got str.',
          serializer = ValidationSerializer(data='invalid data')
          assert not serializer.is_valid()
          assert serializer.errors == {
              'non_field_errors': [
                'Invalid data. Expected a dictionary, but got str.',
              ]
          }
  
  
  # regression tests for issue: 1493
keep keep keep keep 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_validation.py