thunderbird_accounts.authentication.tests.test_admin

Classes

AdminBackfillRecoveryEmailActionTest([...])

AdminCreateUserTestCase([methodName])

AdminDeleteUserTestCase([methodName])

Tests the admin user delete action.

AdminResetTotpCredentialsTestCase([methodName])

AdminUpdateUserTestcase([methodName])

Tests the admin's user update form.

class thunderbird_accounts.authentication.tests.test_admin.AdminCreateUserTestCase(methodName='runTest')[source]

Bases: TestCase

setUp()[source]

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

class thunderbird_accounts.authentication.tests.test_admin.AdminUpdateUserTestcase(methodName='runTest')[source]

Bases: TestCase

Tests the admin’s user update form. We’re mainly trying to make sure updates hit Keycloak as well.

setUp()[source]

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

test_disable_account_clears_app_passwords_through_the_mail_client(mock_mail_client_cls: MagicMock, mock_requests: MagicMock, mock_update_principal: MagicMock, mock_get_principal: MagicMock)

Deactivation goes through clear_app_passwords(), which both client generations implement, rather than reading the legacy secrets list, which a v0.16 Account does not have.

class thunderbird_accounts.authentication.tests.test_admin.AdminDeleteUserTestCase(methodName='runTest')[source]

Bases: TestCase

Tests the admin user delete action. This is just a function/unit test as there’s no form involved here.

setUp()[source]

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

test_success(mock_delete_domain: MagicMock, mock_delete_dkim: MagicMock, mock_delete_hosted_dkim_dns_records: MagicMock, mock_requests: MagicMock, mock_delete_principal: MagicMock)

Tests the full deletion flow: 1. Delete the User model. 2. Send a delete request to Keycloak to remove their login. 3. Send a delete request to Stalwart to remove their email/inbox. 4. Clean up their custom domain in Stalwart and Cloudflare.

test_success_without_stalwart_account(mock_requests: MagicMock, mock_delete_principal: MagicMock)

Tests a partial deletion flow since the user does not have a Stalwart email/inbox setup. 1. Delete the User model. 2. Send a delete request to Keycloak to remove their login. 3. Make sure we didn’t send anything to Stalwart

class thunderbird_accounts.authentication.tests.test_admin.AdminBackfillRecoveryEmailActionTest(methodName='runTest')[source]

Bases: TestCase

setUp()[source]

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

class thunderbird_accounts.authentication.tests.test_admin.AdminResetTotpCredentialsTestCase(methodName='runTest')[source]

Bases: TestCase

setUp()[source]

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