  
  class TestHyperlinkedRelatedField(APISimpleTestCase):
      def setUp(self):
          self.field = serializers.HyperlinkedRelatedField(
              view_name='example', read_only=True)
          self.field.reverse = mock_reverse
          self.field._context = {'request': True}
  
      def test_representation_unsaved_object_with_non_nullable_pk(self):
          representation = self.field.to_representation(MockObject(pk=''))
 
</s>
            view_name='example',
            lookup_field='name',
            lookup_url_kwarg='name',
            queryset=self.queryset,
        )
  
  class TestHyperlinkedRelatedField(APISimpleTestCase):
      def setUp(self):
          self.field = serializers.HyperlinkedRelatedField(
            view_name='example',
            lookup_field='name',
            lookup_url_kwarg='name',
            queryset=self.queryset,
        )
          self.field.reverse = mock_reverse
          self.field._context = {'request': True}
  
      def test_representation_unsaved_object_with_non_nullable_pk(self):
          representation = self.field.to_representation(MockObject(pk=''))
keep keep keep keep replace keep keep keep keep keep
 add URL path unquote to HyperlinkedRelatedField.to_internal_value
tests/test_relations.py