Skip to content

Commit b29f15d

Browse files
scttcperclaude
andcommitted
test(api): Simplify duplicate features test
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent fbf014c commit b29f15d

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

tests/sentry/api/serializers/test_team.py

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -278,21 +278,18 @@ def test_simple(self) -> None:
278278
}
279279

280280
def test_project_on_multiple_teams_no_duplicate_features(self) -> None:
281+
"""A project belonging to multiple teams should not have its features list duplicated."""
281282
user = self.create_user(username="foo")
282283
organization = self.create_organization()
283284
team1 = self.create_team(organization=organization)
284285
team2 = self.create_team(organization=organization)
285-
# Project belongs to both teams
286-
self.create_project(teams=[team1, team2], organization=organization, name="shared")
286+
self.create_project(teams=[team1, team2], organization=organization)
287287

288288
result = serialize([team1, team2], user, TeamWithProjectsSerializer())
289+
features = result[0]["projects"][0]["features"]
289290

290-
for team_data in result:
291-
for project_data in team_data["projects"]:
292-
features = project_data["features"]
293-
assert features == list(dict.fromkeys(features)), (
294-
f"Duplicate features found in project {project_data['slug']}: {features}"
295-
)
291+
assert len(features) > 0
292+
assert features == list(dict.fromkeys(features))
296293

297294

298295
class TeamSCIMSerializerTest(TestCase):

0 commit comments

Comments
 (0)