#NEWLINE# @ mock . patch ( 'simple_elasticsearch.mixins.ElasticsearchIndexMixin.index_add_or_delete' ) #NEWLINE# def test__save_handler( self , mock_index_add_or_delete ) : #NEWLINE# #INDENT# post = BlogPost . objects . create ( blog = self . blog , title = 'blog post title foo' , slug = 'blog-post-title-foo' , body = 'blog post body foo' ) #NEWLINE# mock_index_add_or_delete . assert_called_with ( post ) #NEWLINE# mock_index_add_or_delete . reset_mock ( ) #NEWLINE# post . save ( ) #NEWLINE# mock_index_add_or_delete . assert_called_with ( mock_index_add_or_delete )