diff --git a/tests/sentry/auth/test_helper.py b/tests/sentry/auth/test_helper.py index 9756f0065d470e..693907f37bd288 100644 --- a/tests/sentry/auth/test_helper.py +++ b/tests/sentry/auth/test_helper.py @@ -1,6 +1,5 @@ from unittest import mock -from django.contrib import messages from django.contrib.auth.models import AnonymousUser from django.test import Client, RequestFactory @@ -165,7 +164,7 @@ def test_simple(self, mock_auth): redirect = self.handler.handle_existing_identity(self.state, auth_identity) assert redirect.url == mock_auth.get_login_redirect.return_value - assert mock_auth.get_login_redirect.called_with(self.request) + mock_auth.get_login_redirect.assert_called_with(self.request) persisted_identity = AuthIdentity.objects.get(ident=auth_identity.ident) assert persisted_identity.data == self.identity["data"] @@ -188,7 +187,7 @@ def test_no_invite_members_flag(self, mock_auth): redirect = self.handler.handle_existing_identity(self.state, auth_identity) assert redirect.url == mock_auth.get_login_redirect.return_value - assert mock_auth.get_login_redirect.called_with(self.request) + mock_auth.get_login_redirect.assert_called_with(self.request) persisted_identity = AuthIdentity.objects.get(ident=auth_identity.ident) assert persisted_identity.data == self.identity["data"] @@ -227,8 +226,8 @@ def test_new_identity(self, mock_messages): data=auth_identity.get_audit_log_data(), ).exists() - assert mock_messages.add_message.called_with( - self.request, messages.SUCCESS, OK_LINK_IDENTITY + mock_messages.add_message.assert_called_with( + self.request, mock_messages.SUCCESS, OK_LINK_IDENTITY ) @mock.patch("sentry.auth.helper.messages") @@ -244,8 +243,8 @@ def test_new_identity_with_existing_om(self, mock_messages): assert getattr(persisted_om.flags, "sso:linked") assert not getattr(persisted_om.flags, "sso:invalid") - assert mock_messages.add_message.called_with( - self.request, messages.SUCCESS, OK_LINK_IDENTITY + mock_messages.add_message.assert_called_with( + self.request, mock_messages.SUCCESS, OK_LINK_IDENTITY ) @mock.patch("sentry.auth.helper.messages") diff --git a/tests/sentry/integrations/utils/test_code_mapping.py b/tests/sentry/integrations/utils/test_code_mapping.py index 648bcaa7496391..ce6e118f97efa1 100644 --- a/tests/sentry/integrations/utils/test_code_mapping.py +++ b/tests/sentry/integrations/utils/test_code_mapping.py @@ -226,7 +226,7 @@ def test_more_than_one_repo_match(self, logger): code_mappings = self.code_mapping_helper.generate_code_mappings(stacktraces) # The file appears in more than one repo, thus, we are unable to determine the code mapping assert code_mappings == [] - assert logger.warning.called_with("More than one repo matched sentry/web/urls.py") + logger.warning.assert_called_with("More than one repo matched sentry/web/urls.py") def test_list_file_matches_single(self): frame_filename = FrameFilename("sentry_plugins/slack/client.py") diff --git a/tests/sentry/notifications/utils/test_tasks.py b/tests/sentry/notifications/utils/test_tasks.py index e9ace7ece752db..939508fb4fa4a1 100644 --- a/tests/sentry/notifications/utils/test_tasks.py +++ b/tests/sentry/notifications/utils/test_tasks.py @@ -28,7 +28,7 @@ def test_end_to_end(self, notification): def test_call_task(self, mock_delay): register()(AnotherDummyNotification) async_send_notification(AnotherDummyNotification, self.organization, "some_value") - assert mock_delay.called_with( + mock_delay.assert_called_with( "AnotherDummyNotification", [ {