#NEWLINE# def test_batch_if_not_exists( self ) : #NEWLINE# #INDENT# " ensure 'IF NOT EXISTS' exists in statement when in batch " #NEWLINE# with mock . patch . object ( b . session , 'execute' ) as m : #NEWLINE# #INDENT# with BatchQuery ( ) as b : #NEWLINE# #INDENT# TestIfNotExistsModel . batch ( b ) . if_not_exists ( ) . create ( count = 8 ) #NEWLINE# #UNINDENT# #UNINDENT# self . assertIn ( 'IF NOT EXISTS' , m . call_args [ 0 ] [ 0 ] . query_string )