def test_email_matches_user_on_reset(self):
     non_existant_email_form = PasswordResetForm({
         'username': self.user1.username,
         'email': '*****@*****.**',
     })
     self.assertFalse(non_existant_email_form.is_valid())
     email_stored_for_different_user_form = PasswordResetForm({
         'username': self.user1.username,
         'email': self.user2.email,
     })
     self.assertFalse(email_stored_for_different_user_form.is_valid())
     valid_password_reset_form = PasswordResetForm({
         'username': self.user2.username,
         'email': self.user2.email,
     })
     self.assertTrue(valid_password_reset_form.is_valid())
 def test_username_on_reset(self):
     valid_password_reset_form = PasswordResetForm({
         'username': self.user1.username,
         'email': self.user1.email,
     })
     self.assertTrue(valid_password_reset_form.is_valid())