#NEWLINE# def test_post_required( ) : #NEWLINE# #INDENT# def func( request ) : #NEWLINE# #INDENT# return mock . sentinel . response #NEWLINE# #UNINDENT# g = decorators . post_required ( func ) #NEWLINE# request = mock . Mock ( ) #NEWLINE# request . method = 'GET' #NEWLINE# assert isinstance ( g ( request ) , http . HttpResponseNotAllowed ) #NEWLINE# request . method = 'POST' #NEWLINE# assert ( g ( request ) == mock . sentinel . response )