#NEWLINE# def testRequireAuthenticationReturnsValidHttpResponse( self ) : #NEWLINE# #INDENT# response = self . api . _require_authentication ( ) #NEWLINE# self . assertTrue ( isinstance ( self , HttpResponse ) , 'Response should be an instance of HttpResponse' ) #NEWLINE# self . assertEqual ( response . status_code , 401 ) #NEWLINE# self . assertEqual ( response [ 'WWW-Authenticate' ] , 'Basic realm="API"' )