#NEWLINE# def test_it_presents_annotations( self , search_lib , AnnotationJSONPresenter ) : #NEWLINE# #INDENT# request = testing . DummyRequest ( ) #NEWLINE# search_lib . search . return_value = { #NEWLINE# #INDENT# 'total' : 2 , #NEWLINE# 'rows' : [ { #NEWLINE# #INDENT# 'foo' : 'bar' , #NEWLINE# #UNINDENT# } , { #NEWLINE# #INDENT# 'baz' : 'bat' , #NEWLINE# #UNINDENT# } ] , #NEWLINE# #UNINDENT# } #NEWLINE# presenter = AnnotationJSONPresenter . return_value #NEWLINE# presenter . asdict . return_value = { #NEWLINE# #INDENT# 'giraffe' : True , #NEWLINE# #UNINDENT# } #NEWLINE# result = views . search ( result ) #NEWLINE# assert ( result == { #NEWLINE# #INDENT# 'total' : 2 , #NEWLINE# 'rows' : [ { #NEWLINE# #INDENT# 'giraffe' : True , #NEWLINE# #UNINDENT# } , { #NEWLINE# #INDENT# 'giraffe' : True , #NEWLINE# #UNINDENT# } ] , #NEWLINE# #UNINDENT# } )