def test_mysql_list_compare_with_none(): assert sql_query_dict._mysql_clause( 'x!=', [None, 1, 2, 3], '%s' ) == " ((x IS NOT NULL) AND (x NOT IN (1,2,3)) ) " assert sql_query_dict._mysql_clause( 'x', [None, 1, 2, 3], '%s' ) == " ((x IS NULL) OR (x IN (1,2,3)) ) "
def test_mysql_not_in(): assert sql_query_dict._mysql_clause('x!=', [1, 2, 3], '%s') == \ " (x NOT IN (1,2,3)) "
def test_mysql_not_like(): assert sql_query_dict._mysql_clause('x!~', 'the %', '%s') == \ " (x NOT LIKE %s) "
def test_mysql_string_value(): assert sql_query_dict._mysql_clause('x', 'the', '%s') == \ " (x = %s) "
def test_mysql_list_with_generator(): assert sql_query_dict._mysql_clause( 'x', (x for x in [1, 2, 3]), '%s' ) == " (x IN (1,2,3)) "
def test_mysql_list_with_none(): assert sql_query_dict._mysql_clause('x', [None, False], '%s') == \ ' ((x IS NULL) OR (x IN (False)) ) '
def test_mysql_list_with_or_equals(): assert sql_query_dict._mysql_clause('x|=', [1, 2, 3], '%s') == \ " (x IN (1,2,3)) "