      def test_to_native_custom_format(self):
          """
          Make sure to_native() returns correct custom format.
          """
          f = serializers.TimeField(output_format="%H - %S [%f]")
          result_1 = f.to_native(datetime.time(4, 31))
          result_2 = f.to_native(datetime.time(4, 31, 59))
          result_3 = f.to_native(datetime.time(4, 31, 59, 200))
  
          self.assertEqual('04 - 00 [000000]', result_1)
 
</s> remove         f = serializers.DateTimeField(output_format="%Y - %H:%M")
 </s> add         f = serializers.DateTimeField(format="%Y - %H:%M") </s> remove         self.assertEqual('04 - 59 [000200]', result_3) </s> add  </s> remove         self.assertEquals(serializer.fields['id'].read_only, False)
 </s> add         self.assertEqual(serializer.fields['id'].read_only, False) </s> remove     output_format = api_settings.DATE_OUTPUT_FORMAT
 </s> add     format = api_settings.DATE_FORMAT </s> remove     output_format = api_settings.DATETIME_OUTPUT_FORMAT
 </s> add     format = api_settings.DATETIME_FORMAT
        f = serializers.TimeField(format="%H - %S [%f]")
      def test_to_native_custom_format(self):
          """
          Make sure to_native() returns correct custom format.
          """
        f = serializers.TimeField(format="%H - %S [%f]")
          result_1 = f.to_native(datetime.time(4, 31))
          result_2 = f.to_native(datetime.time(4, 31, 59))
          result_3 = f.to_native(datetime.time(4, 31, 59, 200))
  
          self.assertEqual('04 - 00 [000000]', result_1)
keep keep keep keep replace keep keep keep keep keep
 Clean ups to datetime formatting 
rest_framework/tests/fields.py