#NEWLINE# def test_laxparsers( ) : #NEWLINE# #INDENT# p1 = datetimeparser ( '%Y-%m-%dT%H:%M:%S' ) #NEWLINE# try : #NEWLINE# #INDENT# p1 ( '2002-12-25 00:00:00' ) #NEWLINE# #UNINDENT# except ValueError : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# assert False , 'expected exception' #NEWLINE# #UNINDENT# p2 = datetimeparser ( '%Y-%m-%dT%H:%M:%S' , strict = False ) #NEWLINE# try : #NEWLINE# #INDENT# v = p2 ( '2002-12-25 00:00:00' ) #NEWLINE# #UNINDENT# except ValueError : #NEWLINE# #INDENT# assert False , 'did not expect exception' #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# eq_ ( '2002-12-25 00:00:00' , p1 )