#NEWLINE# def test_exists( self ) : #NEWLINE# #INDENT# ( e1 , e2 ) = self . _case_exists ( ) #NEWLINE# result = to_sql ( e1 ) #NEWLINE# expected = 'SELECT t0.*\nFROM foo t0\nWHERE EXISTS (\n  SELECT 1\n  FROM bar t1\n  WHERE t0.`key1` = t1.`key1`\n)' #NEWLINE# assert ( result == expected ) #NEWLINE# result = to_sql ( e2 ) #NEWLINE# expected = "SELECT t0.*\nFROM foo t0\nWHERE EXISTS (\n  SELECT 1\n  FROM bar t1\n  WHERE t0.`key1` = t1.`key1` AND\n        t1.`key2` = 'foo'\n)" #NEWLINE# assert ( result == expected )