def test_localized_timeField_with_inputformat(self):
        f = forms.TimeField(input_formats=["%I:%M:%S %p", "%I:%M %p"], localize=True)
        # Parse a time in an unaccepted format; get an error
        self.assertRaises(forms.ValidationError, f.clean, '13:30:05')

        # Parse a time in a valid format, get a parsed result
        result = f.clean('1:30:05 PM')
        self.assertEqual(result, time(13,30,5))

        # Check that the parsed result does a round trip to the same format
        text = f.widget._format_value(result)
        self.assertEqual(text, "13:30:05")

        # Parse a time in a valid format, get a parsed result
        result = f.clean('1:30 PM')
        self.assertEqual(result, time(13,30,0))

        # Check that the parsed result does a round trip to default format
        text = f.widget._format_value(result)
        self.assertEqual(text, "13:30:00")
Localized TimeFields with manually specified input formats can accept those formats
dataset/ETHPy150Open AppScale/appscale/AppServer/lib/django-1.2/tests/regressiontests/forms/tests/input_formats.py/SimpleTimeFormatTests.test_localized_timeField_with_inputformat