(self)
| 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( |
nothing calls this directly
no test coverage detected