thunderbird_accounts.authentication.tests.test_models

Classes

UserUsernameValidatorTestCase([methodName])

Verify that the MinLengthValidator is wired to User.username.

class thunderbird_accounts.authentication.tests.test_models.UserUsernameValidatorTestCase(methodName='runTest')[source]

Bases: TestCase

Verify 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.

test_username_at_max_length_passes()[source]

A username of exactly USERNAME_MAX_LENGTH (150) characters is valid.

test_username_above_max_length_raises()[source]

A username longer than USERNAME_MAX_LENGTH (150) fails validation.