#NEWLINE# def test_post_callbacks( self ) : #NEWLINE# #INDENT# 'Rendering a template response triggers the post-render callbacks' #NEWLINE# post = [ ] #NEWLINE# def post1( obj ) : #NEWLINE# #INDENT# post . append ( 'post1' ) #NEWLINE# #UNINDENT# def post2( obj ) : #NEWLINE# #INDENT# post . append ( 'post2' ) #NEWLINE# #UNINDENT# response = SimpleTemplateResponse ( 'first/test.html' , { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } ) #NEWLINE# response . add_post_render_callback ( post1 ) #NEWLINE# response . add_post_render_callback ( post1 ) #NEWLINE# response . render ( ) #NEWLINE# self . assertEqual ( response . content , b'First template\n' ) #NEWLINE# self . assertEqual ( post , [ 'post1' , 'post2' ] )