          data = {'id': 1, 'name': 'source-1', 'target': 'foo'}
          instance = ForeignKeySource.objects.get(pk=1)
          serializer = ForeignKeySourceSerializer(instance, data=data)
          assert not serializer.is_valid()
          assert serializer.errors == {'target': ['Incorrect type. Expected pk value, received %s.' % six.text_type.__name__]}
  
      def test_reverse_foreign_key_update(self):
          data = {'id': 2, 'name': 'target-2', 'sources': [1, 3]}
          instance = ForeignKeyTarget.objects.get(pk=2)
          serializer = ForeignKeyTargetSerializer(instance, data=data)
 
</s> remove     @unittest.skipUnless(ChainMap, 'requires python 3.3')
 </s> add  </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                 'Invalid data. Expected a dictionary, but got %s.' % six.text_type.__name__
 </s> add                 'Invalid data. Expected a dictionary, but got str.', </s> remove                 kwargs = super(NestedPointSerializer, self).to_internal_value(data)
 </s> add                 kwargs = super().to_internal_value(data) </s> remove         request = factory.put('/{0}'.format(filtered_out_pk), data, format='json')
 </s> add         request = factory.put('/{}'.format(filtered_out_pk), data, format='json')
        assert serializer.errors == {'target': ['Incorrect type. Expected pk value, received str.']}
          data = {'id': 1, 'name': 'source-1', 'target': 'foo'}
          instance = ForeignKeySource.objects.get(pk=1)
          serializer = ForeignKeySourceSerializer(instance, data=data)
          assert not serializer.is_valid()
        assert serializer.errors == {'target': ['Incorrect type. Expected pk value, received str.']}
  
      def test_reverse_foreign_key_update(self):
          data = {'id': 2, 'name': 'target-2', 'sources': [1, 3]}
          instance = ForeignKeyTarget.objects.get(pk=2)
          serializer = ForeignKeyTargetSerializer(instance, data=data)
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_relations_pk.py