#NEWLINE# def test_disable_update_on_authenticate( ) : #NEWLINE# #INDENT# db = SQLAlchemy ( 'sqlite:///:memory:' ) #NEWLINE# auth = authcode . Auth ( SECRET_KEY , db = db , hash = 'pbkdf2_sha512' , update_hash = False ) #NEWLINE# User = auth . User #NEWLINE# db . create_all ( ) #NEWLINE# credentials = { #NEWLINE# #INDENT# 'login' : 'meh' , #NEWLINE# 'password' : 'foobar' , #NEWLINE# #UNINDENT# } #NEWLINE# user = User ( ** credentials ) #NEWLINE# db . session . add ( user ) #NEWLINE# db . session . commit ( ) #NEWLINE# deprecated_hash = ph . hex_sha1 . encrypt ( credentials [ 'password' ] ) #NEWLINE# assert ( user . password != deprecated_hash ) #NEWLINE# user . set_raw_password ( deprecated_hash ) #NEWLINE# db . session . commit ( ) #NEWLINE# assert ( user . password == deprecated_hash ) #NEWLINE# auth_user = auth . authenticate ( credentials ) #NEWLINE# assert ( auth_user . password == deprecated_hash )