#NEWLINE# def test_localized_timeField_with_inputformat( self ) : #NEWLINE# #INDENT# 'Localized TimeFields with manually specified input formats can accept those formats' #NEWLINE# f = forms . TimeField ( input_formats = [ '%H.%M.%S' , '%H.%M' ] , localize = True ) #NEWLINE# self . assertRaises ( forms . ValidationError , f . clean , '1:30:05 PM' ) #NEWLINE# self . assertRaises ( forms . ValidationError , f . clean , '13:30:05' ) #NEWLINE# result = f . clean ( '13.30.05' ) #NEWLINE# self . assertEqual ( result , time ( 13 , 30 , 5 ) ) #NEWLINE# text = f . widget . _format_value ( result ) #NEWLINE# self . assertEqual ( text , '13:30:05' ) #NEWLINE# result = f . clean ( '13.30' ) #NEWLINE# self . assertEqual ( result , time ( 13 , 30 , 0 ) ) #NEWLINE# text = f . widget . _format_value ( result ) #NEWLINE# self . assertEqual ( text , '13:30:00' )