#NEWLINE# @ mock . patch . object ( WSGIRequest , 'build_absolute_uri' ) #NEWLINE# def test_suspicious_operation_in_build_absolute_uri( self , build_absolute_uri ) : #NEWLINE# #INDENT# build_absolute_uri . side_effect = SuspiciousOperation ( ) #NEWLINE# request = make_request ( ) #NEWLINE# request . META [ 'HTTP_HOST' ] = 'example.com' #NEWLINE# result = self . raven . get_data_from_request ( request ) #NEWLINE# build_absolute_uri . assert_called_once_with ( ) #NEWLINE# assert ( 'request' in result ) #NEWLINE# assert ( result [ 'request' ] [ 'url' ] == 'http://example.com/' )