File tree Expand file tree Collapse file tree 1 file changed +5
-8
lines changed
tests/sentry/api/serializers Expand file tree Collapse file tree 1 file changed +5
-8
lines changed Original file line number Diff line number Diff 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
298295class TeamSCIMSerializerTest (TestCase ):
You can’t perform that action at this time.
0 commit comments