#NEWLINE# def test_insert_special( self ) : #NEWLINE# #INDENT# iq = InsertQuery ( CSVRow , { #NEWLINE# #INDENT# CSVRow . data : [ 'foo' , 'bar' , 'baz' ] , #NEWLINE# #UNINDENT# } ) #NEWLINE# self . assertEqual ( compiler . generate_insert ( iq ) , ( 'INSERT INTO "csvrow" ("data") VALUES (?)' , [ 'foo,bar,baz' ] ) ) #NEWLINE# iq = InsertQuery ( CSVRow , { #NEWLINE# #INDENT# CSVRow . data : [ ] , #NEWLINE# #UNINDENT# } ) #NEWLINE# self . assertEqual ( compiler . generate_insert ( iq ) , ( 'INSERT INTO "csvrow" ("data") VALUES (?)' , [ '' ] ) ) #NEWLINE# iq = InsertQuery ( CSVRow , rows = [ { #NEWLINE# #INDENT# CSVRow . data : [ 'foo' , 'bar' , 'baz' ] , #NEWLINE# #UNINDENT# } , { #NEWLINE# #INDENT# CSVRow . data : [ 'a' , 'b' ] , #NEWLINE# #UNINDENT# } , { #NEWLINE# #INDENT# CSVRow . data : [ 'b' ] , #NEWLINE# #UNINDENT# } , { #NEWLINE# #INDENT# CSVRow . data : [ ] , #NEWLINE# #UNINDENT# } ] ) #NEWLINE# self . assertEqual ( compiler . generate_insert ( iq ) , ( 'INSERT INTO "csvrow" ("data") VALUES (?), (?), (?), (?)' , [ 'foo,bar,baz' , 'a,b' , 'b' , '' ] ) )