MCPcopy
hub / github.com/django/django / test_inactive_user

Method test_inactive_user

tests/auth_tests/test_forms.py:1307–1317  ·  view source on GitHub ↗

Inactive user cannot receive password reset email.

(self)

Source from the content-addressed store, hash-verified

1305 self.assertEqual(user.email, "tesT")
1306
1307 def test_inactive_user(self):
1308 """
1309 Inactive user cannot receive password reset email.
1310 """
1311 user, username, email = self.create_dummy_user()
1312 user.is_active = False
1313 user.save()
1314 form = PasswordResetForm({"email": email})
1315 self.assertTrue(form.is_valid())
1316 form.save()
1317 self.assertEqual(len(mail.outbox), 0)
1318
1319 def test_unusable_password(self):
1320 user = User.objects.create_user("testuser", "test@example.com", "test")

Callers

nothing calls this directly

Calls 5

create_dummy_userMethod · 0.95
saveMethod · 0.95
PasswordResetFormClass · 0.90
saveMethod · 0.45
is_validMethod · 0.45

Tested by

no test coverage detected