#NEWLINE# def test_dateTimeField( self ) : #NEWLINE# #INDENT# 'DateTimeFields can parse dates in the default format' #NEWLINE# f = forms . DateTimeField ( ) #NEWLINE# self . assertRaises ( forms . ValidationError , f . clean , '1:30:05 PM 21/12/2010' ) #NEWLINE# result = f . clean ( '21.12.2010 13:30:05' ) #NEWLINE# self . assertEqual ( result , datetime ( 2010 , 12 , 21 , 13 , 30 , 5 ) ) #NEWLINE# text = f . widget . _format_value ( result ) #NEWLINE# self . assertEqual ( text , '21.12.2010 13:30:05' ) #NEWLINE# result = f . clean ( '21.12.2010 13:30' ) #NEWLINE# self . assertEqual ( result , datetime ( 2010 , 12 , 21 , 13 , 30 ) ) #NEWLINE# text = f . widget . _format_value ( result ) #NEWLINE# self . assertEqual ( text , '21.12.2010 13:30:00' )