Skip to content

fix(taskworker): Pass simple types to prepare_organization_report task in tests #90768

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

Merged
merged 2 commits into from
May 2, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions tests/sentry/tasks/test_weekly_reports.py
Original file line number Diff line number Diff line change
Expand Up @@ -634,7 +634,7 @@ def test_message_builder_multiple_users_prevent_resend(self, message_builder, re

# TODO(RyanSkonnord): Make sure this doesn't cause false negatives after
# batch IDs are also used to prevent duplicate sends
batch_id = UUID("ea18c80c-d44f-48a4-8973-b0daa3169c44")
batch_id = str(UUID("ea18c80c-d44f-48a4-8973-b0daa3169c44"))

with (
mock.patch(
Expand Down Expand Up @@ -887,6 +887,7 @@ def test_group_status_to_color_obj_correct_length(self):
@mock.patch("sentry.tasks.summaries.weekly_reports.MessageBuilder")
def test_email_override_simple(self, message_builder, record):
user = self.create_user(email="[email protected]")
user_id = user.id
self.create_member(teams=[self.team], user=user, organization=self.organization)
extra_team = self.create_team(organization=self.organization)
# create an extra project to ensure our email only gets the user's project
Expand All @@ -902,7 +903,7 @@ def test_email_override_simple(self, message_builder, record):
self.organization.id,
self._dummy_batch_id,
dry_run=False,
target_user=user,
target_user=user_id,
email_override="[email protected]",
)

Expand Down Expand Up @@ -932,7 +933,7 @@ def test_user_with_team_and_no_projects(self, message_builder, record):
project = self.create_project(organization=organization)

user = self.create_user(email="[email protected]")

user_id = user.id
extra_team = self.create_team(organization=organization, members=[])
self.create_member(teams=[extra_team], user=user, organization=organization)

Expand All @@ -944,7 +945,7 @@ def test_user_with_team_and_no_projects(self, message_builder, record):
organization.id,
self._dummy_batch_id,
dry_run=False,
target_user=user,
target_user=user_id,
)

for call_args in message_builder.call_args_list:
Expand Down Expand Up @@ -1001,7 +1002,7 @@ def test_email_override_invalid_target_user(self, logger):
# fill with data so report not skipped
self.store_event_outcomes(org.id, proj.id, self.two_days_ago, num_times=2)

batch_id = UUID("ef61f1d1-41a3-4530-8160-615466937076")
batch_id = str(UUID("ef61f1d1-41a3-4530-8160-615466937076"))
prepare_organization_report(
self.timestamp,
ONE_DAY * 7,
Expand Down
Loading