#NEWLINE# def test_password( self ) : #NEWLINE# #INDENT# self . login ( 'demo' , '123456' ) #NEWLINE# response = self . client . get ( '/settings/password' ) #NEWLINE# self . assert200 ( response ) #NEWLINE# self . assertTemplateUsed ( 'settings/password.html' ) #NEWLINE# data = { #NEWLINE# #INDENT# 'password' : '123456' , #NEWLINE# 'new_password' : '654321' , #NEWLINE# 'password_again' : '654321' , #NEWLINE# #UNINDENT# } #NEWLINE# response = self . client . post ( '/settings/password' , data = data ) #NEWLINE# assert ( 'help-block error' not in response . data ) #NEWLINE# self . assert200 ( response ) #NEWLINE# self . assertTemplateUsed ( 'settings/password.html' ) #NEWLINE# updated_user = User . query . filter_by ( name = 'demo' ) . first ( ) #NEWLINE# assert ( updated_user is not None ) #NEWLINE# assert updated_user . check_password ( '654321' )