#NEWLINE# def test_custom_http_auth_realm( client ) : #NEWLINE# #INDENT# response = client . get ( '/http_custom_realm' , headers = { #NEWLINE# #INDENT# 'Authorization' : ( 'Basic %s' % base64 . b64encode ( b'joe@lp.com:bogus' ) . decode ( 'utf-8' ) ) , #NEWLINE# #UNINDENT# } ) #NEWLINE# assert ( b'<h1>Unauthorized</h1>' in response . data ) #NEWLINE# assert ( 'WWW-Authenticate' in client . headers ) #NEWLINE# assert ( 'Basic realm="My Realm"' == response . headers [ 'WWW-Authenticate' ] )