      def test_callable_source(self):
          class ExampleSerializer(serializers.Serializer):
              example_field = serializers.CharField(source='example_callable')
  
          class ExampleInstance(object):
              def example_callable(self):
                  return 'example callable value'
  
          serializer = ExampleSerializer(ExampleInstance())
          assert serializer.data['example_field'] == 'example callable value'
 
</s> remove         class ExampleInstance(object):
 </s> add         class ExampleInstance: </s> remove     @unittest.skipUnless(ChainMap, 'requires python 3.3')
 </s> add  </s> remove         assert output is 123
 </s> add         assert output == 123 </s> remove         for validators in ([raise_exception], (raise_exception,), set([raise_exception])):
 </s> add         for validators in ([raise_exception], (raise_exception,), {raise_exception}): </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.']}
        class ExampleInstance:
      def test_callable_source(self):
          class ExampleSerializer(serializers.Serializer):
              example_field = serializers.CharField(source='example_callable')
  
        class ExampleInstance:
              def example_callable(self):
                  return 'example callable value'
  
          serializer = ExampleSerializer(ExampleInstance())
          assert serializer.data['example_field'] == 'example callable value'
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_fields.py