#NEWLINE# def assertIsDecorated( self , function , decorator_name ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# decorator_list = function . __decorators__ #NEWLINE# #UNINDENT# except AttributeError : #NEWLINE# #INDENT# decorator_list = [ ] #NEWLINE# #UNINDENT# self . assertIn ( decorator_name , decorator_list , msg = "'{}' method should be decorated with 'module_required'" . format ( function . __name__ ) )