thunderbird_accounts.authentication.tests.test_middleware

Classes

AccountsOIDCBackendTestCase([methodName])

OIDCRefreshSessionTestCase([methodName])

RefreshUserAccessTokenTestCase([methodName])

class thunderbird_accounts.authentication.tests.test_middleware.RefreshUserAccessTokenTestCase(methodName='runTest')[source]

Bases: TestCase

class thunderbird_accounts.authentication.tests.test_middleware.OIDCRefreshSessionTestCase(methodName='runTest')[source]

Bases: TestCase

setUp()[source]

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

test_introspect_does_not_happen_without_feature_flag(mock_post: MagicMock)

This should hit the ‘not expired’ check and do nothing.

test_introspect_does_happen_if_feature_flag_is_set(mock_post: MagicMock)

This should hit a request.post, and our expected result for this test is the token is active.

test_introspect_if_access_token_is_inactive(mock_post: MagicMock)

This should hit a request.post fail due to token being inactive, and refresh successfully.

test_allow_post_reauth_does_not_happen_without_feature_flag(mock_post: MagicMock)

Try posting without this feature flag. It should set a “not refreshable” state.

test_allow_post_reauth_does_happen_with_feature_flag(mock_post: MagicMock)

Try posting with this feature flag. It should mention it’s not expired.

class thunderbird_accounts.authentication.tests.test_middleware.AccountsOIDCBackendTestCase(methodName='runTest')[source]

Bases: TestCase

setUp()[source]

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

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.

test_update_active_user_doesnt_check_allowlist()[source]

Testing update_user to make sure not including is_services_admin in claim will leave is_staff, and is_superuser fields alone.

test_update_inactive_user_does_check_allowlist()[source]

Testing update_user to make sure not including is_services_admin in claim will leave is_staff, and is_superuser fields alone.