thunderbird_accounts.mail.tests.test_views

Classes

ActiveSubscriptionRequiredMailViewsTestCase([...])

AddEmailAliasTestCase([methodName])

AppPasswordApiTestCase([methodName])

AppointmentCalDAVSetupTestCase([methodName])

CustomDomainDNSRecordsTestCase([methodName])

DisplayNameApiTestCase([methodName])

RemoveCustomDomainTestCase([methodName])

VerifyCustomDomainTestCase([methodName])

class thunderbird_accounts.mail.tests.test_views.AppPasswordApiTestCase(methodName='runTest')[source]

Bases: TestCase

setUp()[source]

Hook method for setting up the test fixture before exercising it.

class thunderbird_accounts.mail.tests.test_views.DisplayNameApiTestCase(methodName='runTest')[source]

Bases: TestCase

setUp()[source]

Hook method for setting up the test fixture before exercising it.

class thunderbird_accounts.mail.tests.test_views.ActiveSubscriptionRequiredMailViewsTestCase(methodName='runTest')[source]

Bases: TestCase

setUp()[source]

Hook method for setting up the test fixture before exercising it.

class thunderbird_accounts.mail.tests.test_views.CustomDomainDNSRecordsTestCase(methodName='runTest')[source]

Bases: TestCase

setUp()[source]

Hook method for setting up the test fixture before exercising it.

class thunderbird_accounts.mail.tests.test_views.VerifyCustomDomainTestCase(methodName='runTest')[source]

Bases: TestCase

setUp()[source]

Hook method for setting up the test fixture before exercising it.

test_reverification_of_bad_domain_is_success(mock_mail_client_cls, mock_check_stale_dns_records, mock_publish_hosted_dkim)

This test-case is a reverification of a VERIFIED domain that does not have a Stalwart entry

test_reverification_of_unverified_domain_is_success(mock_mail_client_cls, mock_check_stale_dns_records, mock_publish_hosted_dkim)

This test-case is a reverification of a VERIFIED domain that does not have a Stalwart entry

class thunderbird_accounts.mail.tests.test_views.RemoveCustomDomainTestCase(methodName='runTest')[source]

Bases: TestCase

setUp()[source]

Hook method for setting up the test fixture before exercising it.

class thunderbird_accounts.mail.tests.test_views.AddEmailAliasTestCase(methodName='runTest')[source]

Bases: TestCase

setUp()[source]

Hook method for setting up the test fixture before exercising it.

test_reserved_with_custom_domain()[source]

Ensure that creating an email alias with a reserved word for a custom domain is ok.

test_already_used_alias()[source]

Ensure that creating an email alias that is already in-use will error out.

test_already_used_alias_case_sensitive()[source]

Ensure that creating an email alias with differing case that is already in-use will error out.

test_allowed_domain_alias_too_short()

Test that email aliases shorter than 3 characters are rejected for ALLOWED_EMAIL_DOMAINS.

test_allowed_domains_alias_too_long()

Test that email aliases longer than 150 characters are rejected for ALLOWED_EMAIL_DOMAINS.

test_allowed_domain_alias_minimum_length()

Test that email aliases of exactly 3 characters are accepted for ALLOWED_EMAIL_DOMAINS.

test_custom_domain_alias_short_allowed()

Test that short email aliases (< 3 chars) are allowed for custom domains (not in ALLOWED_EMAIL_DOMAINS).

test_custom_domain_alias_length_minimum_2()

Test that MIN_CUSTOM_DOMAIN_ALIAS_LENGTH=2 works correctly for both allowed and custom domains.

class thunderbird_accounts.mail.tests.test_views.AppointmentCalDAVSetupTestCase(methodName='runTest')[source]

Bases: TestCase

setUp()[source]

Hook method for setting up the test fixture before exercising it.

test_missing_appointment_secret()

Test that missing appointment-secret returns 400 error.

test_invalid_appointment_secret()

Test that invalid appointment-secret returns 400 error.

test_missing_oidc_access_token()

Test that missing oidc-access-token returns 400 error.

test_appointment_caldav_secret_not_set()

Test that 500 is returned when APPOINTMENT_CALDAV_SECRET is not set.

test_oidc_validation_failure(mock_backend_cls)

Test that 401 is returned when OIDC token validation fails.

test_user_not_found(mock_backend_cls)

Test that 404 is returned when user is not found.

test_user_without_active_subscription(mock_backend_cls)

Test that 400 is returned when user does not have an active subscription.

test_success_existing_app_password_replaced(mock_mail_client_cls, mock_save_app_password, mock_backend_cls, mock_token_urlsafe)

Test that an existing app password is deleted and replaced with a new one.

test_success_new_app_password_created(mock_mail_client_cls, mock_save_app_password, mock_backend_cls, mock_token_urlsafe)

Test successful creation of new app password when no matching one exists.

test_success_no_existing_secrets(mock_mail_client_cls, mock_save_app_password, mock_backend_cls, mock_token_urlsafe)

Test successful creation when user has no existing secrets.

test_exception_handling(mock_mail_client_cls, mock_capture_exception, mock_backend_cls)

Test that exceptions are caught and return 500 error.

test_invalid_json_body()

Test that invalid JSON body returns 400 error.