")
# The username is added to the password reset confirmation form to help
# browser's password managers.
self.assertContains(
response,
'',
)
@override_settings(AUTH_USER_MODEL="auth_tests.CustomUser")
def test_password_reset_confirm_view_custom_username_hint(self):
custom_user = CustomUser.custom_objects.create_user(
email="joe@example.com",
date_of_birth=date(1986, 11, 11),
first_name="Joe",
)
client = PasswordResetConfirmClient()
default_token_generator = PasswordResetTokenGenerator()
token = default_token_generator.make_token(custom_user)
uidb64 = urlsafe_base64_encode(str(custom_user.pk).encode())
url = reverse(
"password_reset_confirm", kwargs={"uidb64": uidb64, "token": token}
)
response = client.get(url)
self.assertContains(
response,
"Enter new password | Django site admin",
)
self.assertContains(response, "
Enter new password
")
# The username field is added to the password reset confirmation form
# to help browser's password managers.
self.assertContains(
response,
'',
)
def test_password_reset_complete_view(self):
response = PasswordResetCompleteView.as_view()(self.request)
self.assertContains(
response, "Password reset complete | Django site admin"
)
self.assertContains(response, "