-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
ref(auth): Extract reusable methods from SSO identity handler #121013
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -37,6 +37,7 @@ | |
| from sentry.testutils.helpers.options import override_options | ||
| from sentry.testutils.hybrid_cloud import HybridCloudTestMixin | ||
| from sentry.testutils.silo import assume_test_silo_mode, control_silo_test | ||
| from sentry.users.models.user import User | ||
| from sentry.utils import json | ||
| from sentry.utils.redis import clusters | ||
|
|
||
|
|
@@ -171,6 +172,12 @@ def test_unauthenticated_with_no_email_match_resolves_to_anonymous(self) -> None | |
|
|
||
| @control_silo_test | ||
| class HandleNewUserTest(AuthIdentityHandlerTest, HybridCloudTestMixin): | ||
| @mock.patch("sentry.analytics.record") | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This looks unused? |
||
| def test_skip_confirm_emails_suppresses_email(self, mock_record: mock.MagicMock) -> None: | ||
| with mock.patch.object(User, "send_confirm_emails") as mock_send: | ||
| self.handler.handle_new_user(skip_confirm_emails=True) | ||
| mock_send.assert_not_called() | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should we add the inverse too? Nothing currently asserts the email is sent when |
||
|
|
||
| @mock.patch("sentry.analytics.record") | ||
| def test_simple(self, mock_record: mock.MagicMock) -> None: | ||
| auth_identity = self.handler.handle_new_user() | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This might not be relevant but are you sure
email_verifiedoutput a Boolean?sentry/src/sentry/auth/providers/google/provider.py
Line 99 in 65d8513