#NEWLINE# def test_dateField_with_inputformat( self ) : #NEWLINE# #INDENT# 'DateFields with manually specified input formats can accept those formats' #NEWLINE# f = forms . DateField ( input_formats = [ '%d.%m.%Y' , '%d-%m-%Y' ] ) #NEWLINE# self . assertRaises ( forms . ValidationError , self . clean , '2010-12-21' ) #NEWLINE# result = f . clean ( '21.12.2010' ) #NEWLINE# self . assertEqual ( result , date ( 2010 , 12 , 21 ) ) #NEWLINE# text = f . widget . _format_value ( result ) #NEWLINE# self . assertEqual ( text , '2010-12-21' ) #NEWLINE# result = f . clean ( '21-12-2010' ) #NEWLINE# self . assertEqual ( result , date ( 2010 , 12 , 21 ) ) #NEWLINE# text = f . widget . _format_value ( result ) #NEWLINE# self . assertEqual ( text , '2010-12-21' )