  # Generics.
  class ExampleSerializer(serializers.Serializer):
      date = serializers.DateField()
      datetime = serializers.DateTimeField()
      hstore = serializers.HStoreField()
      uuid_field = serializers.UUIDField(default=uuid.uuid4)
  
  
  class ExampleGenericAPIView(generics.GenericAPIView):
      serializer_class = ExampleSerializer
 
</s> remove         return json.dumps(data, indent=2).encode('utf-8')
 </s> add         return json.dumps(data, cls=self.encoder_class, indent=2).encode('utf-8') </s> remove     BaseRenderer, BrowsableAPIRenderer, JSONRenderer, OpenAPIRenderer
 </s> add     BaseRenderer, BrowsableAPIRenderer, JSONOpenAPIRenderer, JSONRenderer,
    OpenAPIRenderer
    duration = serializers.DurationField(default=timedelta())
  # Generics.
  class ExampleSerializer(serializers.Serializer):
      date = serializers.DateField()
      datetime = serializers.DateTimeField()
    duration = serializers.DurationField(default=timedelta())
      hstore = serializers.HStoreField()
      uuid_field = serializers.UUIDField(default=uuid.uuid4)
  
  
  class ExampleGenericAPIView(generics.GenericAPIView):
      serializer_class = ExampleSerializer
keep keep keep add keep keep keep keep keep keep
 Fix OpenAPISchema rendering for timedelta (#7641)

* Add failing test when rendering to json a schema with timedelta

* Fix JSONOpenAPIRenderer for fields with default=timedelta()

* fix isort

* fix test for python 3.5

Co-authored-by: Pierre Chiquet <pierre.chiquet@ubikey.fr> 
tests/schemas/views.py