#NEWLINE# def test_where_negation( self ) : #NEWLINE# #INDENT# sq = SelectQuery ( Blog ) . where ( ( ~ ( Blog . title == 'foo' ) ) ) #NEWLINE# self . assertWhere ( self , 'NOT ("blog"."title" = ?)' , [ 'foo' ] ) #NEWLINE# sq = SelectQuery ( Blog ) . where ( ( ~ ( ( Blog . title == 'foo' ) | ( Blog . title == 'bar' ) ) ) ) #NEWLINE# self . assertWhere ( sq , 'NOT (("blog"."title" = ?) OR ("blog"."title" = ?))' , [ 'foo' , 'bar' ] ) #NEWLINE# sq = SelectQuery ( Blog ) . where ( ( ( ~ ( ( Blog . title == 'foo' ) & ( Blog . title == 'bar' ) ) ) & ( Blog . title == 'baz' ) ) ) #NEWLINE# self . assertWhere ( sq , '(NOT (("blog"."title" = ?) AND ("blog"."title" = ?)) AND ("blog"."title" = ?))' , [ 'foo' , 'bar' , 'baz' ] ) #NEWLINE# sq = SelectQuery ( Blog ) . where ( ( ( ~ ( ( Blog . title == 'foo' ) & ( Blog . title == 'bar' ) ) ) & ( ( Blog . title == 'baz' ) & ( Blog . title == 'fizz' ) ) ) ) #NEWLINE# self . assertWhere ( sq , '(NOT (("blog"."title" = ?) AND ("blog"."title" = ?)) AND (("blog"."title" = ?) AND ("blog"."title" = ?)))' , [ 'foo' , 'bar' , 'baz' , 'fizz' ] )