'Localized TimeFields with manually specified input formats can accept those formats'

def test_localized_timeField_with_inputformat(self):

    f = forms.TimeField(input_formats=['%H.%M.%S', '%H.%M'], localize=True)
    with self.assertRaises(forms.ValidationError):
        f.clean('1:30:05    PM')
    with self.assertRaises(forms.ValidationError):
        f.clean('13:30:05')
    result = f.clean('13.30.05')
    self.assertEqual(result, time(13, 30, 5))
    text = f.widget.format_value(result)
    self.assertEqual(text, '01:30:05    PM')
    result = f.clean('13.30')
    self.assertEqual(result, time(13, 30, 0))
    text = f.widget.format_value(result)
    self.assertEqual(text, '01:30:00    PM')
