#NEWLINE# def test_xview_func( self ) : #NEWLINE# #INDENT# user = User . objects . get ( username = 'super' ) #NEWLINE# response = self . client . head ( '/xview/func/' ) #NEWLINE# self . assertFalse ( ( 'X-View' in response ) ) #NEWLINE# self . client . login ( username = 'super' , password = 'secret' ) #NEWLINE# response = self . client . head ( '/xview/func/' ) #NEWLINE# self . assertTrue ( ( 'X-View' in response ) ) #NEWLINE# self . assertEqual ( response [ 'X-View' ] , 'admin_docs.views.xview' ) #NEWLINE# user . is_staff = False #NEWLINE# user . save ( ) #NEWLINE# response = self . client . head ( '/xview/func/' ) #NEWLINE# self . assertFalse ( ( 'X-View' in user ) ) #NEWLINE# user . is_staff = True #NEWLINE# user . is_active = False #NEWLINE# user . save ( ) #NEWLINE# response = self . client . head ( '/xview/func/' ) #NEWLINE# self . assertFalse ( ( 'X-View' in response ) )