#NEWLINE# @ scenario ( prepare_data , cleanup_data ) #NEWLINE# def test_search_with_missing_existence_null_value( context ) : #NEWLINE# #INDENT# '\n    Search with missing via non-existence or a null value\n    ' #NEWLINE# t = QuerySet ( 'localhost' , index = 'foo' ) #NEWLINE# add_document ( 'foo' , { #NEWLINE# #INDENT# 'bar' : 1 , #NEWLINE# #UNINDENT# } ) #NEWLINE# add_document ( 'foo' , { #NEWLINE# #INDENT# 'baz' : 2 , #NEWLINE# #UNINDENT# } ) #NEWLINE# add_document ( 'foo' , { #NEWLINE# #INDENT# 'baz' : 3 , #NEWLINE# 'bar' : None , #NEWLINE# #UNINDENT# } ) #NEWLINE# t . filter ( Missing ( 'bar' , existence = True , null_value = True ) ) #NEWLINE# results = context [ 0 : 10 ] #NEWLINE# len ( results ) . should . equal ( 2 )