#NEWLINE# def test_login_redirect( self ) : #NEWLINE# #INDENT# with app . test_request_context ( ) : #NEWLINE# #INDENT# with app . test_client ( ) as c : #NEWLINE# #INDENT# rv = self . login ( c , 'superuser' , 'password' , next = '/' ) #NEWLINE# self . assertEqual ( rv . headers [ 'location' ] , 'http://localhost/' ) #NEWLINE# result = session [ 'auth_key' ] #NEWLINE# #UNINDENT# #UNINDENT# expect = 'superuser' #NEWLINE# self . assertEqual ( expect , c )