add label filters in org/{org_name}/issues
This commit is contained in:
parent
ba35934824
commit
8d13ed4a8d
7 changed files with 169 additions and 59 deletions
|
@ -15,6 +15,7 @@ import (
|
|||
"testing"
|
||||
"time"
|
||||
|
||||
org_model "code.gitea.io/gitea/models/organization"
|
||||
access_model "code.gitea.io/gitea/models/perm/access"
|
||||
repo_model "code.gitea.io/gitea/models/repo"
|
||||
"code.gitea.io/gitea/models/unittest"
|
||||
|
@ -146,6 +147,19 @@ func LoadUser(t *testing.T, ctx gocontext.Context, userID int64) {
|
|||
}
|
||||
}
|
||||
|
||||
// LoadOrganization load an org into a test context
|
||||
func LoadOrganization(t *testing.T, ctx gocontext.Context, orgID int64) {
|
||||
org := unittest.AssertExistsAndLoadBean(t, &org_model.Organization{ID: orgID})
|
||||
switch ctx := ctx.(type) {
|
||||
case *context.Context:
|
||||
ctx.Org.Organization = org
|
||||
case *context.APIContext:
|
||||
ctx.Org.Organization = org
|
||||
default:
|
||||
assert.FailNow(t, "context is not *context.Context or *context.APIContext")
|
||||
}
|
||||
}
|
||||
|
||||
// LoadGitRepo load a git repo into a test context. Requires that ctx.Repo has
|
||||
// already been populated.
|
||||
func LoadGitRepo(t *testing.T, ctx *context.Context) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue