#NEWLINE# def test_escape_string( self ) : #NEWLINE# #INDENT# con = self . connections [ 0 ] #NEWLINE# cur = con . cursor ( ) #NEWLINE# self . assertEqual ( con . escape ( "foo'bar" ) , "'foo\\'bar'" ) #NEWLINE# cur . execute ( "SET sql_mode='NO_BACKSLASH_ESCAPES,NO_AUTO_CREATE_USER'" ) #NEWLINE# self . assertEqual ( con . escape ( "foo'bar" ) , "'foo''bar'" )