#NEWLINE# def test_no_impersonation( self ) : #NEWLINE# #INDENT# 'Test that the view will reject those actively impersonating' #NEWLINE# user = self . create_user ( ) #NEWLINE# user . impersonating = True #NEWLINE# request = self . request_factory . get ( '/' ) #NEWLINE# request . user = user #NEWLINE# with self . assertRaises ( PermissionDenied ) : #NEWLINE# #INDENT# self . view_class . as_view ( ) ( user )