diff --git a/tests/sentry/api/endpoints/test_group_notes.py b/tests/sentry/api/endpoints/test_group_notes.py index 3a3c4dce39efa4..58a9ad3057a346 100644 --- a/tests/sentry/api/endpoints/test_group_notes.py +++ b/tests/sentry/api/endpoints/test_group_notes.py @@ -52,7 +52,6 @@ def test_note_merge(self): data={"text": "This looks bad :)"}, datetime=now - datetime.timedelta(days=70), ) - assert note1.data is not None note2 = Activity.objects.create( group=group1, project=project1, @@ -61,7 +60,6 @@ def test_note_merge(self): data={"text": "Yeah we should probably look into this"}, datetime=now - datetime.timedelta(days=66), ) - assert note2.data is not None project2 = self.create_project() group2 = self.create_group(project2) @@ -74,7 +72,6 @@ def test_note_merge(self): data={"text": "I have been a good Sentry :)"}, datetime=now - datetime.timedelta(days=90), ) - assert note3.data is not None note4 = Activity.objects.create( group=group2, project=project2, @@ -83,7 +80,6 @@ def test_note_merge(self): data={"text": "You have been a bad user :)"}, datetime=now - datetime.timedelta(days=88), ) - assert note4.data is not None with self.tasks(): merge_groups([group1.id], group2.id) diff --git a/tests/sentry/event_manager/test_event_manager.py b/tests/sentry/event_manager/test_event_manager.py index 3e5976794b7e4d..78531ab52b18a7 100644 --- a/tests/sentry/event_manager/test_event_manager.py +++ b/tests/sentry/event_manager/test_event_manager.py @@ -357,7 +357,6 @@ def test_marks_as_unresolved_with_new_release( assert group.status == GroupStatus.RESOLVED activity = Activity.objects.get(id=activity.id) - assert activity.data is not None assert activity.data["version"] == "" assert GroupResolution.objects.filter(group=group).exists() @@ -372,7 +371,6 @@ def test_marks_as_unresolved_with_new_release( assert group.status == GroupStatus.UNRESOLVED activity = Activity.objects.get(id=activity.id) - assert activity.data is not None assert activity.data["version"] == "b" assert not GroupResolution.objects.filter(group=group).exists() @@ -433,13 +431,11 @@ def test_that_release_in_latest_activity_prior_to_regression_is_not_overridden( assert group.status == GroupStatus.UNRESOLVED activity = Activity.objects.get(id=activity.id) - assert activity.data is not None assert activity.data["version"] == "foobar" regressed_activity = Activity.objects.get( group=group, type=ActivityType.SET_REGRESSION.value ) - assert regressed_activity.data is not None assert regressed_activity.data["version"] == "b" assert regressed_activity.data["follows_semver"] is False @@ -497,14 +493,12 @@ def test_current_release_version_in_latest_activity_prior_to_regression_is_not_o assert group.status == GroupStatus.UNRESOLVED activity = Activity.objects.get(id=activity.id) - assert activity.data is not None assert activity.data["version"] == "b" assert activity.data["current_release_version"] == "pre foobar" regressed_activity = Activity.objects.get( group=group, type=ActivityType.SET_REGRESSION.value ) - assert regressed_activity.data is not None assert regressed_activity.data["version"] == "b" mock_send_activity_notifications_delay.assert_called_once_with(regressed_activity.id) @@ -561,13 +555,11 @@ def test_resolved_in_release_regression_activity_follows_semver( assert group.status == GroupStatus.UNRESOLVED activity = Activity.objects.get(id=activity.id) - assert activity.data is not None assert activity.data["version"] == "foo@1.0.0" regressed_activity = Activity.objects.get( group=group, type=ActivityType.SET_REGRESSION.value ) - assert regressed_activity.data is not None assert regressed_activity.data["version"] == "foo@2.0.0" assert regressed_activity.data["follows_semver"] is True assert regressed_activity.data["resolved_in_version"] == "foo@1.0.0" @@ -843,7 +835,6 @@ def test_marks_as_unresolved_with_new_release_with_integration( assert group.status == GroupStatus.RESOLVED activity = Activity.objects.get(id=activity.id) - assert activity.data is not None assert activity.data["version"] == "" assert GroupResolution.objects.filter(group=group).exists() @@ -862,7 +853,6 @@ def test_marks_as_unresolved_with_new_release_with_integration( assert group.status == GroupStatus.UNRESOLVED activity = Activity.objects.get(id=activity.id) - assert activity.data is not None assert activity.data["version"] == "b" assert not GroupResolution.objects.filter(group=group).exists() diff --git a/tests/sentry/integrations/msteams/notifications/test_note.py b/tests/sentry/integrations/msteams/notifications/test_note.py index 2fc30f423e6131..4a648b04418d53 100644 --- a/tests/sentry/integrations/msteams/notifications/test_note.py +++ b/tests/sentry/integrations/msteams/notifications/test_note.py @@ -45,7 +45,6 @@ def test_note(self, mock_send_card: MagicMock): f"[{self.group.title}](http://testserver/organizations/{self.organization.slug}/issues/{self.group.id}/?referrer=note\\_activity-msteams&notification\\_uuid=" in body[1]["text"] ) - assert notification.activity.data is not None assert notification.activity.data["text"] == body[2]["text"] notification_uuid = self.get_notification_uuid(body[3]["columns"][1]["items"][0]["text"]) assert ( diff --git a/tests/sentry/integrations/msteams/notifications/test_resolved.py b/tests/sentry/integrations/msteams/notifications/test_resolved.py index 8b977c5fbecf78..612d036e479823 100644 --- a/tests/sentry/integrations/msteams/notifications/test_resolved.py +++ b/tests/sentry/integrations/msteams/notifications/test_resolved.py @@ -82,7 +82,6 @@ def test_resolved_in_release(self, mock_send_card): body = args[1]["body"] assert 4 == len(body) - assert notification.activity.data is not None release_name = notification.activity.data["version"] assert ( f"Issue marked as resolved in {release_name} by {self.user.get_display_name()}" diff --git a/tests/sentry/issues/endpoints/test_organization_group_index.py b/tests/sentry/issues/endpoints/test_organization_group_index.py index f3b4f083934617..343e5a376af929 100644 --- a/tests/sentry/issues/endpoints/test_organization_group_index.py +++ b/tests/sentry/issues/endpoints/test_organization_group_index.py @@ -4112,7 +4112,6 @@ def test_self_assign_issue_next_release(self) -> None: activity = Activity.objects.get( group=group, type=ActivityType.SET_RESOLVED_IN_RELEASE.value ) - assert activity.data is not None assert activity.data["version"] == "" with assume_test_silo_mode(SiloMode.CONTROL): uo1.delete() @@ -4179,7 +4178,6 @@ def test_in_semver_projects_group_resolution_stores_current_release_version(self ident=grp_resolution.id, ) - assert activity.data is not None assert activity.data["current_release_version"] == release_2.version def test_in_non_semver_projects_group_resolution_stores_current_release_version(self) -> None: @@ -4329,7 +4327,6 @@ def test_in_non_semver_projects_resolved_in_next_release_is_equated_to_in_releas type=ActivityType.SET_RESOLVED_IN_RELEASE.value, ident=grp_resolution.id, ) - assert activity.data is not None assert activity.data["version"] == release_2.version def test_selective_status_update(self) -> None: @@ -4399,7 +4396,6 @@ def test_set_resolved_in_current_release(self) -> None: activity = Activity.objects.get( group=group, type=ActivityType.SET_RESOLVED_IN_RELEASE.value ) - assert activity.data is not None assert activity.data["version"] == release.version assert GroupHistory.objects.filter( group=group, status=GroupHistoryStatus.SET_RESOLVED_IN_RELEASE @@ -4441,7 +4437,6 @@ def test_set_resolved_in_explicit_release(self) -> None: activity = Activity.objects.get( group=group, type=ActivityType.SET_RESOLVED_IN_RELEASE.value ) - assert activity.data is not None assert activity.data["version"] == release.version def test_in_semver_projects_set_resolved_in_explicit_release(self) -> None: @@ -4486,7 +4481,6 @@ def test_in_semver_projects_set_resolved_in_explicit_release(self) -> None: activity = Activity.objects.get( group=group, type=ActivityType.SET_RESOLVED_IN_RELEASE.value ) - assert activity.data is not None assert activity.data["version"] == release_1.version assert GroupResolution.has_resolution(group=group, release=release_2) @@ -4524,7 +4518,6 @@ def test_set_resolved_in_next_release(self) -> None: activity = Activity.objects.get( group=group, type=ActivityType.SET_RESOLVED_IN_RELEASE.value ) - assert activity.data is not None assert activity.data["version"] == "" def test_set_resolved_in_next_release_legacy(self) -> None: @@ -4562,7 +4555,6 @@ def test_set_resolved_in_next_release_legacy(self) -> None: activity = Activity.objects.get( group=group, type=ActivityType.SET_RESOLVED_IN_RELEASE.value ) - assert activity.data is not None assert activity.data["version"] == "" def test_set_resolved_in_explicit_commit_unreleased(self) -> None: @@ -4595,7 +4587,6 @@ def test_set_resolved_in_explicit_commit_unreleased(self) -> None: ).exists() activity = Activity.objects.get(group=group, type=ActivityType.SET_RESOLVED_IN_COMMIT.value) - assert activity.data is not None assert activity.data["commit"] == commit.id assert GroupHistory.objects.filter( group=group, status=GroupHistoryStatus.SET_RESOLVED_IN_COMMIT @@ -4634,7 +4625,6 @@ def test_set_resolved_in_explicit_commit_released(self) -> None: ).exists() activity = Activity.objects.get(group=group, type=ActivityType.SET_RESOLVED_IN_COMMIT.value) - assert activity.data is not None assert activity.data["commit"] == commit.id resolution = GroupResolution.objects.get(group=group) diff --git a/tests/sentry/issues/test_status_change.py b/tests/sentry/issues/test_status_change.py index dec4a913646044..2f6ae96b041030 100644 --- a/tests/sentry/issues/test_status_change.py +++ b/tests/sentry/issues/test_status_change.py @@ -83,7 +83,6 @@ def test_ignore_new_issue(self, issue_ignored: Any) -> None: assert issue_ignored.called activity = Activity.objects.get(group=self.group, type=ActivityType.SET_IGNORED.value) - assert activity.data is not None assert activity.data.get("ignoreDuration") == 30 assert GroupHistory.objects.filter( @@ -107,7 +106,6 @@ def test_ignore_until_escalating(self, issue_ignored: Any) -> None: assert issue_ignored.called activity = Activity.objects.get(group=self.group, type=ActivityType.SET_IGNORED.value) - assert activity.data is not None assert activity.data.get("ignoreUntilEscalating") assert GroupHistory.objects.filter( diff --git a/tests/sentry/models/test_activity.py b/tests/sentry/models/test_activity.py index aa7c6fe279177a..990238edd698ac 100644 --- a/tests/sentry/models/test_activity.py +++ b/tests/sentry/models/test_activity.py @@ -49,7 +49,6 @@ def test_get_activities_for_group_priority(self): assert act_for_group[0] == activities[-1] assert act_for_group[1] == activities[-2] assert act_for_group[-1].type == ActivityType.FIRST_SEEN.value - assert act_for_group[-1].data is not None assert act_for_group[-1].data["priority"] == PriorityLevel.HIGH.to_str() def test_get_activities_for_group_simple_priority_ff_on_dups(self): @@ -91,7 +90,6 @@ def test_get_activities_for_group_simple_priority_ff_on_dups(self): assert act_for_group[0] == activities[-1] assert act_for_group[1] == activities[-2] assert act_for_group[-1].type == ActivityType.FIRST_SEEN.value - assert act_for_group[-1].data is not None assert act_for_group[-1].data["priority"] == PriorityLevel.HIGH.to_str() def test_get_activities_for_group_simple(self): diff --git a/tests/sentry/models/test_deploy.py b/tests/sentry/models/test_deploy.py index f1b9c98666b3b2..9493a67a82c99d 100644 --- a/tests/sentry/models/test_deploy.py +++ b/tests/sentry/models/test_deploy.py @@ -62,7 +62,6 @@ def test_no_commits_no_head_commits(self): activity = Activity.objects.get( type=ActivityType.DEPLOY.value, project=project, ident=release.version ) - assert activity.data is not None assert activity.data["deploy_id"] == deploy.id assert Deploy.objects.get(id=deploy.id).notified is True @@ -113,6 +112,5 @@ def test_no_commits_fetch_complete(self): activity = Activity.objects.get( type=ActivityType.DEPLOY.value, project=project, ident=release.version ) - assert activity.data is not None assert activity.data["deploy_id"] == deploy.id assert Deploy.objects.get(id=deploy.id).notified is True diff --git a/tests/sentry/models/test_groupassignee.py b/tests/sentry/models/test_groupassignee.py index d07523e54d5000..e634f27d2d13e5 100644 --- a/tests/sentry/models/test_groupassignee.py +++ b/tests/sentry/models/test_groupassignee.py @@ -41,7 +41,6 @@ def test_assign_user(self): project=self.group.project, group=self.group, type=ActivityType.ASSIGNED.value ) - assert activity.data is not None assert activity.data["assignee"] == str(self.user.id) assert activity.data["assigneeEmail"] == self.user.email assert activity.data["assigneeType"] == "user" @@ -57,7 +56,6 @@ def test_assign_team(self): project=self.group.project, group=self.group, type=ActivityType.ASSIGNED.value ) - assert activity.data is not None assert activity.data["assignee"] == str(self.team.id) assert activity.data["assigneeEmail"] is None assert activity.data["assigneeType"] == "team" @@ -72,7 +70,6 @@ def test_create_only(self): activity = Activity.objects.get( project=self.group.project, group=self.group, type=ActivityType.ASSIGNED.value ) - assert activity.data is not None assert activity.data["assignee"] == str(self.user.id) assert activity.data["assigneeEmail"] == self.user.email assert activity.data["assigneeType"] == "user" @@ -88,7 +85,6 @@ def test_create_only(self): activity = Activity.objects.get( project=self.group.project, group=self.group, type=ActivityType.ASSIGNED.value ) - assert activity.data is not None assert activity.data["assignee"] == str(self.user.id) assert activity.data["assigneeEmail"] == self.user.email assert activity.data["assigneeType"] == "user" @@ -112,12 +108,10 @@ def test_reassign_user_to_team(self): ).order_by("id") ) - assert activity[0].data is not None assert activity[0].data["assignee"] == str(self.user.id) assert activity[0].data["assigneeEmail"] == self.user.email assert activity[0].data["assigneeType"] == "user" - assert activity[1].data is not None assert activity[1].data["assignee"] == str(self.team.id) assert activity[1].data["assigneeEmail"] is None assert activity[1].data["assigneeType"] == "team" @@ -171,7 +165,6 @@ def test_assignee_sync_outbound_assign(self, mock_sync_assignee_outbound): project=self.group.project, group=self.group, type=ActivityType.ASSIGNED.value ) - assert activity.data is not None assert activity.data["assignee"] == str(self.user.id) assert activity.data["assigneeEmail"] == self.user.email assert activity.data["assigneeType"] == "user" diff --git a/tests/sentry/tasks/test_clear_expired_resolutions.py b/tests/sentry/tasks/test_clear_expired_resolutions.py index 675bf1a1fc6bc5..f97e3a40d350fa 100644 --- a/tests/sentry/tasks/test_clear_expired_resolutions.py +++ b/tests/sentry/tasks/test_clear_expired_resolutions.py @@ -71,9 +71,7 @@ def test_simple(self): assert resolution2.status == GroupResolution.Status.pending activity1 = Activity.objects.get(id=activity1.id) - assert activity1.data is not None assert activity1.data["version"] == new_release.version activity2 = Activity.objects.get(id=activity2.id) - assert activity2.data is not None assert activity2.data["version"] == "" diff --git a/tests/sentry/tasks/test_email.py b/tests/sentry/tasks/test_email.py index f4be5bb7068b7e..8205297356ca45 100644 --- a/tests/sentry/tasks/test_email.py +++ b/tests/sentry/tasks/test_email.py @@ -15,7 +15,6 @@ def test_simple(self): activity = Activity.objects.get(group=group, type=ActivityType.NOTE.value) assert activity.user_id == self.user.id - assert activity.data is not None assert activity.data["text"] == "hello world!" def test_handle_unknown_address(self): diff --git a/tests/sentry/tasks/test_sentry_apps.py b/tests/sentry/tasks/test_sentry_apps.py index bb9544af881957..672d0e0bee86a1 100644 --- a/tests/sentry/tasks/test_sentry_apps.py +++ b/tests/sentry/tasks/test_sentry_apps.py @@ -467,7 +467,6 @@ def setUp(self): user_id=self.user.id, data={"text": "hello world"}, ) - assert self.note.data is not None self.data = { "comment_id": self.note.id, "timestamp": self.note.datetime, diff --git a/tests/snuba/api/endpoints/test_group_details.py b/tests/snuba/api/endpoints/test_group_details.py index 283c6556e02567..bfed6d0e73be7a 100644 --- a/tests/snuba/api/endpoints/test_group_details.py +++ b/tests/snuba/api/endpoints/test_group_details.py @@ -241,7 +241,6 @@ def test_group_post_priority(self): assert act_for_group[0].type == ActivityType.SET_PRIORITY.value assert act_for_group[-1].type == ActivityType.FIRST_SEEN.value assert act_for_group[0].user_id == self.user.id - assert act_for_group[0].data is not None assert act_for_group[0].data["priority"] == "high" get_response_after = self.client.get(url, format="json") diff --git a/tests/snuba/api/endpoints/test_project_group_index.py b/tests/snuba/api/endpoints/test_project_group_index.py index 770715759ed2a1..3fcc04c6e73ab6 100644 --- a/tests/snuba/api/endpoints/test_project_group_index.py +++ b/tests/snuba/api/endpoints/test_project_group_index.py @@ -607,7 +607,6 @@ def test_self_assign_issue_next_release(self): activity = Activity.objects.get( group=group, type=ActivityType.SET_RESOLVED_IN_RELEASE.value ) - assert activity.data is not None assert activity.data["version"] == "" with assume_test_silo_mode(SiloMode.CONTROL): uo1.delete() @@ -683,7 +682,6 @@ def test_set_resolved_in_current_release(self): activity = Activity.objects.get( group=group, type=ActivityType.SET_RESOLVED_IN_RELEASE.value ) - assert activity.data is not None assert activity.data["version"] == release.version def test_set_resolved_in_explicit_release(self): @@ -724,7 +722,6 @@ def test_set_resolved_in_explicit_release(self): activity = Activity.objects.get( group=group, type=ActivityType.SET_RESOLVED_IN_RELEASE.value ) - assert activity.data is not None assert activity.data["version"] == release.version def test_set_resolved_in_next_release(self): @@ -763,7 +760,6 @@ def test_set_resolved_in_next_release(self): activity = Activity.objects.get( group=group, type=ActivityType.SET_RESOLVED_IN_RELEASE.value ) - assert activity.data is not None assert activity.data["version"] == "" def test_set_resolved_in_next_release_legacy(self): @@ -797,7 +793,6 @@ def test_set_resolved_in_next_release_legacy(self): activity = Activity.objects.get( group=group, type=ActivityType.SET_RESOLVED_IN_RELEASE.value ) - assert activity.data is not None assert activity.data["version"] == "" @with_feature("organizations:resolve-in-upcoming-release") @@ -837,7 +832,6 @@ def test_set_resolved_in_upcoming_release(self): activity = Activity.objects.get( group=group, type=ActivityType.SET_RESOLVED_IN_RELEASE.value ) - assert activity.data is not None assert activity.data["version"] == "" def test_upcoming_release_flag_validation(self): @@ -912,7 +906,6 @@ def test_set_resolved_in_explicit_commit_unreleased(self): ).exists() activity = Activity.objects.get(group=group, type=ActivityType.SET_RESOLVED_IN_COMMIT.value) - assert activity.data is not None assert activity.data["commit"] == commit.id def test_set_resolved_in_explicit_commit_released(self): @@ -952,7 +945,6 @@ def test_set_resolved_in_explicit_commit_released(self): ).exists() activity = Activity.objects.get(group=group, type=ActivityType.SET_RESOLVED_IN_COMMIT.value) - assert activity.data is not None assert activity.data["commit"] == commit.id resolution = GroupResolution.objects.get(group=group)