mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-06-21 12:37:19 -04:00
parent
f8a1094406
commit
c548dde205
83 changed files with 336 additions and 320 deletions
|
@ -6,6 +6,7 @@ package org
|
|||
import (
|
||||
"testing"
|
||||
|
||||
"code.gitea.io/gitea/models/db"
|
||||
"code.gitea.io/gitea/models/organization"
|
||||
repo_model "code.gitea.io/gitea/models/repo"
|
||||
"code.gitea.io/gitea/models/unittest"
|
||||
|
@ -19,7 +20,7 @@ func TestTeam_AddRepository(t *testing.T) {
|
|||
testSuccess := func(teamID, repoID int64) {
|
||||
team := unittest.AssertExistsAndLoadBean(t, &organization.Team{ID: teamID})
|
||||
repo := unittest.AssertExistsAndLoadBean(t, &repo_model.Repository{ID: repoID})
|
||||
assert.NoError(t, TeamAddRepository(team, repo))
|
||||
assert.NoError(t, TeamAddRepository(db.DefaultContext, team, repo))
|
||||
unittest.AssertExistsAndLoadBean(t, &organization.TeamRepo{TeamID: teamID, RepoID: repoID})
|
||||
unittest.CheckConsistencyFor(t, &organization.Team{ID: teamID}, &repo_model.Repository{ID: repoID})
|
||||
}
|
||||
|
@ -28,6 +29,6 @@ func TestTeam_AddRepository(t *testing.T) {
|
|||
|
||||
team := unittest.AssertExistsAndLoadBean(t, &organization.Team{ID: 1})
|
||||
repo := unittest.AssertExistsAndLoadBean(t, &repo_model.Repository{ID: 1})
|
||||
assert.Error(t, TeamAddRepository(team, repo))
|
||||
assert.Error(t, TeamAddRepository(db.DefaultContext, team, repo))
|
||||
unittest.CheckConsistencyFor(t, &organization.Team{ID: 1}, &repo_model.Repository{ID: 1})
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue