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

Method test_inactive_user

tests/auth_tests/test_forms.py:508–518  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

506 )
507
508 def test_inactive_user(self):
509 # The user is inactive.
510 data = {
511 "username": "inactive",
512 "password": "password",
513 }
514 form = AuthenticationForm(None, data)
515 self.assertFalse(form.is_valid())
516 self.assertEqual(
517 form.non_field_errors(), [str(form.error_messages["inactive"])]
518 )
519
520 # Use an authentication backend that rejects inactive users.
521 @override_settings(

Callers

nothing calls this directly

Calls 3

AuthenticationFormClass · 0.90
is_validMethod · 0.45
non_field_errorsMethod · 0.45

Tested by

no test coverage detected