#NEWLINE# def test_localized_dateField( self ) : #NEWLINE# #INDENT# 'Localized DateFields act as unlocalized widgets' #NEWLINE# f = forms . DateField ( localize = True ) #NEWLINE# self . assertRaises ( forms . ValidationError , f . 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 ( f , '21.12.2010' ) #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 , '21.12.2010' )