          serializer = TimeObjectCustomFormatSerializer(data={'time': '04:31'})
          self.assertFalse(serializer.is_valid())
          self.assertEquals(serializer.errors, {'time': ['Time has wrong format. Use one of these formats instead: HH -- MM; HHMMSS']})
  
      def test_from_native(self):
          f = serializers.TimeField()
          result = f.from_native('12:34:56')
  
          self.assertEqual(datetime.time(12, 34, 56), result)
  
 
</s> remove         result = f.from_native('12:34:56')
 </s> add         result_1 = f.from_native('04:31')
        result_2 = f.from_native('04:31:59')
        result_3 = f.from_native('04:31:59.000200') </s> remove     def test_wrong_custom_time_input_format(self):
        serializer = TimeObjectCustomFormatSerializer(data={'time': '04:31'})
        self.assertFalse(serializer.is_valid())
        self.assertEquals(serializer.errors, {'time': ['Time has wrong format. Use one of these formats instead: HH -- MM; HHMMSS']})
 </s> add  </s> remove     def test_wrong_default_time_input_format(self):
        serializer = TimeObjectSerializer(data={'time': 'something wrong'})
        self.assertFalse(serializer.is_valid())
        self.assertEquals(serializer.errors, {'time': ['Time has wrong format. Use one of these formats instead: HH:MM:SS; HH:MM']})
 </s> add         self.assertEqual('1984 - 00:00', result_1)
        self.assertEqual('1984 - 04:31', result_2)
        self.assertEqual('1984 - 04:31', result_3)
        self.assertEqual('1984 - 04:31', result_4) </s> remove         self.assertEqual(datetime.time(12, 34, 56), result)
 </s> add         self.assertEqual(datetime.time(4, 31), result_1)
        self.assertEqual(datetime.time(4, 31, 59), result_2)
        self.assertEqual(datetime.time(4, 31, 59, 200), result_3) </s> remove         serializer = TimeObjectCustomFormatSerializer(data={'time': '043159'})
        self.assertTrue(serializer.is_valid())
 </s> add         result_1 = f.to_native(datetime.datetime(1984, 7, 31))
        result_2 = f.to_native(datetime.datetime(1984, 7, 31, 4, 31))
        result_3 = f.to_native(datetime.datetime(1984, 7, 31, 4, 31, 59))
        result_4 = f.to_native(datetime.datetime(1984, 7, 31, 4, 31, 59, 200))
class TimeFieldTest(TestCase):
    """
    Tests for the TimeField from_native() and to_native() behavior
    """

    def test_from_native_string(self):
        """
        Make sure from_native() accepts default iso input formats.
        """
          serializer = TimeObjectCustomFormatSerializer(data={'time': '04:31'})
          self.assertFalse(serializer.is_valid())
          self.assertEquals(serializer.errors, {'time': ['Time has wrong format. Use one of these formats instead: HH -- MM; HHMMSS']})
  
class TimeFieldTest(TestCase):
    """
    Tests for the TimeField from_native() and to_native() behavior
    """

    def test_from_native_string(self):
        """
        Make sure from_native() accepts default iso input formats.
        """
          f = serializers.TimeField()
          result = f.from_native('12:34:56')
  
          self.assertEqual(datetime.time(12, 34, 56), result)
  
keep keep keep keep replace keep keep keep keep keep
 Add drf settings + output format + testcases 
rest_framework/tests/fields.py