#NEWLINE# def test_permission_denied( self ) : #NEWLINE# #INDENT# user = self . user #NEWLINE# request = self . request #NEWLINE# DecRole2 . assign_role_to_user ( user ) #NEWLINE# with self . assertRaises ( PermissionDenied ) : #NEWLINE# #INDENT# response = HasPermissionDetailView . as_view ( ) ( request )