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

        # Parse a time in a valid format, get a parsed result
        result = f.clean('13.30.05')
        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, "01:30:05 PM")

        # Parse a time in a valid format, get a parsed result
        result = f.clean('13.30')
        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, "01:30:00 PM")
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/CustomTimeInputFormatsTests.test_localized_timeField_with_inputformat