thunderbird_accounts.authentication.tests.test_models
Classes
|
Verify that the MinLengthValidator is wired to User.username. |
- class thunderbird_accounts.authentication.tests.test_models.UserUsernameValidatorTestCase(methodName='runTest')[source]
Bases:
TestCaseVerify that the MinLengthValidator is wired to User.username.
max_length is enforced at the DB column level by Django’s CharField. min_length is enforced only via validators, so it is important to confirm the validator is actually attached to the field.
- test_username_at_min_length_passes()[source]
A username of exactly USERNAME_MIN_LENGTH (3) characters is valid.
- test_username_below_min_length_raises()[source]
A username shorter than USERNAME_MIN_LENGTH (3) fails validation.