#NEWLINE# def test_titles( self ) : #NEWLINE# #INDENT# rf = RequestFactory ( ) #NEWLINE# user = User . objects . create_user ( 'jsmith' , 'jsmith@example.com' , 'pass' ) #NEWLINE# user = authenticate ( username = user . username , password = 'pass' ) #NEWLINE# request = rf . get ( '/somepath/' ) #NEWLINE# request . user = user #NEWLINE# response = password_reset ( request , post_reset_redirect = 'dummy/' ) #NEWLINE# self . assertContains ( response , '<title>Password reset</title>' ) #NEWLINE# self . assertContains ( response , '<h1>Password reset</h1>' ) #NEWLINE# response = password_reset_done ( request ) #NEWLINE# self . assertContains ( response , '<title>Password reset sent</title>' ) #NEWLINE# self . assertContains ( response , '<h1>Password reset sent</h1>' ) #NEWLINE# response = password_reset_confirm ( request , uidb64 = 'Bad' , token = 'Bad' , post_reset_redirect = 'dummy/' ) #NEWLINE# self . assertContains ( response , '<title>Password reset unsuccessful</title>' ) #NEWLINE# self . assertContains ( response , '<h1>Password reset unsuccessful</h1>' ) #NEWLINE# default_token_generator = PasswordResetTokenGenerator ( ) #NEWLINE# token = default_token_generator . make_token ( user ) #NEWLINE# uidb64 = force_text ( urlsafe_base64_encode ( force_bytes ( user . pk ) ) ) #NEWLINE# response = password_reset_confirm ( request , uidb64 , token , post_reset_redirect = 'dummy/' ) #NEWLINE# self . assertContains ( response , '<title>Enter new password</title>' ) #NEWLINE# self . assertContains ( response , '<h1>Enter new password</h1>' ) #NEWLINE# response = password_reset_complete ( request ) #NEWLINE# self . assertContains ( response , '<title>Password reset complete</title>' ) #NEWLINE# self . assertContains ( response , '<h1>Password reset complete</h1>' ) #NEWLINE# response = password_change ( user , post_change_redirect = 'dummy/' ) #NEWLINE# self . assertContains ( response , '<title>Password change</title>' ) #NEWLINE# self . assertContains ( response , '<h1>Password change</h1>' ) #NEWLINE# response = password_change_done ( request ) #NEWLINE# self . assertContains ( response , '<title>Password change successful</title>' ) #NEWLINE# self . assertContains ( response , '<h1>Password change successful</h1>' )