diff options
Diffstat (limited to 'models/organization/team_test.go')
-rw-r--r-- | models/organization/team_test.go | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/models/organization/team_test.go b/models/organization/team_test.go index 829c440c29..c8d58a0eb7 100644 --- a/models/organization/team_test.go +++ b/models/organization/team_test.go @@ -17,22 +17,22 @@ import ( func TestTeam_IsOwnerTeam(t *testing.T) { assert.NoError(t, unittest.PrepareTestDatabase()) - team := unittest.AssertExistsAndLoadBean(t, &organization.Team{ID: 1}).(*organization.Team) + team := unittest.AssertExistsAndLoadBean(t, &organization.Team{ID: 1}) assert.True(t, team.IsOwnerTeam()) - team = unittest.AssertExistsAndLoadBean(t, &organization.Team{ID: 2}).(*organization.Team) + team = unittest.AssertExistsAndLoadBean(t, &organization.Team{ID: 2}) assert.False(t, team.IsOwnerTeam()) } func TestTeam_IsMember(t *testing.T) { assert.NoError(t, unittest.PrepareTestDatabase()) - team := unittest.AssertExistsAndLoadBean(t, &organization.Team{ID: 1}).(*organization.Team) + team := unittest.AssertExistsAndLoadBean(t, &organization.Team{ID: 1}) assert.True(t, team.IsMember(2)) assert.False(t, team.IsMember(4)) assert.False(t, team.IsMember(unittest.NonexistentID)) - team = unittest.AssertExistsAndLoadBean(t, &organization.Team{ID: 2}).(*organization.Team) + team = unittest.AssertExistsAndLoadBean(t, &organization.Team{ID: 2}) assert.True(t, team.IsMember(2)) assert.True(t, team.IsMember(4)) assert.False(t, team.IsMember(unittest.NonexistentID)) @@ -42,7 +42,7 @@ func TestTeam_GetRepositories(t *testing.T) { assert.NoError(t, unittest.PrepareTestDatabase()) test := func(teamID int64) { - team := unittest.AssertExistsAndLoadBean(t, &organization.Team{ID: teamID}).(*organization.Team) + team := unittest.AssertExistsAndLoadBean(t, &organization.Team{ID: teamID}) assert.NoError(t, team.GetRepositoriesCtx(db.DefaultContext)) assert.Len(t, team.Repos, team.NumRepos) for _, repo := range team.Repos { @@ -57,7 +57,7 @@ func TestTeam_GetMembers(t *testing.T) { assert.NoError(t, unittest.PrepareTestDatabase()) test := func(teamID int64) { - team := unittest.AssertExistsAndLoadBean(t, &organization.Team{ID: teamID}).(*organization.Team) + team := unittest.AssertExistsAndLoadBean(t, &organization.Team{ID: teamID}) assert.NoError(t, team.GetMembersCtx(db.DefaultContext)) assert.Len(t, team.Members, team.NumMembers) for _, member := range team.Members { @@ -126,7 +126,7 @@ func TestGetTeamMembers(t *testing.T) { assert.NoError(t, unittest.PrepareTestDatabase()) test := func(teamID int64) { - team := unittest.AssertExistsAndLoadBean(t, &organization.Team{ID: teamID}).(*organization.Team) + team := unittest.AssertExistsAndLoadBean(t, &organization.Team{ID: teamID}) members, err := organization.GetTeamMembers(db.DefaultContext, &organization.SearchMembersOptions{ TeamID: teamID, }) @@ -173,7 +173,7 @@ func TestHasTeamRepo(t *testing.T) { assert.NoError(t, unittest.PrepareTestDatabase()) test := func(teamID, repoID int64, expected bool) { - team := unittest.AssertExistsAndLoadBean(t, &organization.Team{ID: teamID}).(*organization.Team) + team := unittest.AssertExistsAndLoadBean(t, &organization.Team{ID: teamID}) assert.Equal(t, expected, organization.HasTeamRepo(db.DefaultContext, team.OrgID, teamID, repoID)) } test(1, 1, false) |