#NEWLINE# def test_password_encrypted( self ) : #NEWLINE# #INDENT# 'Simple paste with an encrypted password, expect a 200 and a match' #NEWLINE# text = 'String for hashed password test' #NEWLINE# password = hashlib . sha1 ( 'hashed password' . encode ( ) ) . hexdigest ( ) #NEWLINE# rsp = self . app . post ( '/post' , { #NEWLINE# #INDENT# 'upload' : text , #NEWLINE# 'password' : password , #NEWLINE# 'is_encrypted' : 'yes' , #NEWLINE# #UNINDENT# } ) #NEWLINE# assert ( rsp . status == '200 OK' ) #NEWLINE# url = urlparse . urlparse ( rsp . body ) #NEWLINE# rsp = self . app . post ( '/raw{0}' . format ( url . path . decode ( ) ) , { #NEWLINE# #INDENT# 'password' : password . encode ( ) , #NEWLINE# 'is_encrypted' : 'yes' , #NEWLINE# #UNINDENT# } ) #NEWLINE# assert ( rsp . status == '200 OK' ) #NEWLINE# assert ( rsp . body . decode ( ) == text )