thunderbird_accounts.mail.tests.test_utils
Classes
|
create_stalwart_account should seed the Stalwart description with the user's display name. |
|
|
|
Tests for validate_email, focused on the local-part length check. |
- class thunderbird_accounts.mail.tests.test_utils.ValidateEmailTestCase(methodName='runTest')[source]
Bases:
TestCaseTests for validate_email, focused on the local-part length check.
USERNAME_MIN_LENGTH = 3 → local parts shorter than 3 chars are rejected USERNAME_MAX_LENGTH = 150 → local parts longer than 150 chars are rejected
- test_local_part_at_min_length_is_valid()[source]
A local part of exactly USERNAME_MIN_LENGTH (3) characters is accepted.
- test_local_part_one_below_min_raises()[source]
A local part of USERNAME_MIN_LENGTH - 1 (2) characters is rejected.
- test_local_part_at_max_length_is_valid()[source]
A local part of exactly USERNAME_MAX_LENGTH (150) characters is accepted.
- test_local_part_above_max_raises()[source]
A local part longer than USERNAME_MAX_LENGTH (150) is rejected.
- test_invalid_email_format_raises()[source]
A string with ‘@’ but an otherwise invalid format is rejected.
- test_custom_error_message_is_used()[source]
The caller-supplied error_message is propagated in the exception.
- class thunderbird_accounts.mail.tests.test_utils.CreateStalwartAccountTestCase(methodName='runTest')[source]
Bases:
TestCasecreate_stalwart_account should seed the Stalwart description with the user’s display name.
- class thunderbird_accounts.mail.tests.test_utils.IsAddressTakenTestCase(methodName='runTest')[source]
Bases:
TestCase- test_success()
If no one is using the address then it’s not ‘taken’.
- test_fail_due_to_user()
Ensure that if a user is using that address, that it will be ‘taken’.
- test_fail_due_to_email_alias()
Ensure that if an email alias exists of that address, that it will be ‘taken’.
- test_fail_due_to_stalwart()[source]
Same as the other fail tests but we test both with the waffle switch off (return false) and switch on (return true)
- test_check_remote_false_skips_stalwart_lookup()
Even with the switch on,
check_remote=Falsemust not hit Stalwart.
- test_stalwart_account_not_found_is_not_taken()
A clean AccountNotFoundError from Stalwart means the address is free.
- test_stalwart_invalid_jmap_response_is_treated_as_taken()
If we can’t parse Stalwart’s response we can’t prove the address is free, so treat it as taken.