thunderbird_accounts.authentication.tests
Classes
|
|
|
|
|
Tests the admin user delete action. |
|
Tests the admin's user update form. |
|
|
|
- class thunderbird_accounts.authentication.tests.AdminCreateUserTestCase(methodName='runTest')[source]
Bases:
TestCase
- class thunderbird_accounts.authentication.tests.AdminUpdateUserTestcase(methodName='runTest')[source]
Bases:
TestCaseTests the admin’s user update form. We’re mainly trying to make sure updates hit Keycloak as well.
- class thunderbird_accounts.authentication.tests.AdminDeleteUserTestCase(methodName='runTest')[source]
Bases:
TestCaseTests the admin user delete action. This is just a function/unit test as there’s no form involved here.
- test_success(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.
- 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.AccountsOIDCBackendTestCase(methodName='runTest')[source]
Bases:
TestCase- test_update_user_dont_reset_services_admin_permissions()[source]
Testing update_user to make sure not including is_services_admin in claim will leave is_staff, and is_superuser fields alone.
- class thunderbird_accounts.authentication.tests.IsReservedUnitTests(methodName='runTest')[source]
Bases:
TestCase
- class thunderbird_accounts.authentication.tests.SignUpViewTestcase(methodName='runTest')[source]
Bases:
TestCase- test_success(mock_import_user: MagicMock)
Test that an unauthenticated user can sign-up if they’re in the allow list.
- test_not_on_allowed_list(mock_import_user: MagicMock)
Test that a recovery email not on the allow list will ship them to the wait list
- test_user_already_exists(mock_import_user: MagicMock)
Test that we check if a user exists before creating a user