#NEWLINE# def test_clone_filters( self ) : #NEWLINE# #INDENT# q = SearchQuery ( 'dummy' , document_class = FakeDocument ) . filter ( ( ( Q ( foo = 'bar' ) | Q ( foo = 'baz' ) ) & ( ~ Q ( foo = 'neg' ) ) ) ) #NEWLINE# q1 = q . filter ( ( ~ Q ( foo = 'neg2' ) ) ) #NEWLINE# self . assertEqual ( '(((foo:"bar") OR (foo:"baz")) AND NOT (foo:"neg"))' , unicode ( q1 . query ) ) #NEWLINE# self . assertEqual ( '((((foo:"bar") OR (foo:"baz")) AND NOT (foo:"neg")) AND NOT (foo:"neg2"))' , unicode ( q1 . query ) )