summaryrefslogtreecommitdiffstats
path: root/routers/web/repo/issue_label_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'routers/web/repo/issue_label_test.go')
-rw-r--r--routers/web/repo/issue_label_test.go15
1 files changed, 8 insertions, 7 deletions
diff --git a/routers/web/repo/issue_label_test.go b/routers/web/repo/issue_label_test.go
index 8c3caabe17..98fa9eb968 100644
--- a/routers/web/repo/issue_label_test.go
+++ b/routers/web/repo/issue_label_test.go
@@ -11,6 +11,7 @@ import (
"code.gitea.io/gitea/models"
"code.gitea.io/gitea/models/db"
+ "code.gitea.io/gitea/models/unittest"
"code.gitea.io/gitea/modules/test"
"code.gitea.io/gitea/modules/web"
"code.gitea.io/gitea/services/forms"
@@ -30,7 +31,7 @@ func int64SliceToCommaSeparated(a []int64) string {
}
func TestInitializeLabels(t *testing.T) {
- db.PrepareTestEnv(t)
+ unittest.PrepareTestEnv(t)
ctx := test.MockContext(t, "user2/repo1/labels/initialize")
test.LoadUser(t, ctx, 2)
test.LoadRepo(t, ctx, 2)
@@ -46,7 +47,7 @@ func TestInitializeLabels(t *testing.T) {
}
func TestRetrieveLabels(t *testing.T) {
- db.PrepareTestEnv(t)
+ unittest.PrepareTestEnv(t)
for _, testCase := range []struct {
RepoID int64
Sort string
@@ -73,7 +74,7 @@ func TestRetrieveLabels(t *testing.T) {
}
func TestNewLabel(t *testing.T) {
- db.PrepareTestEnv(t)
+ unittest.PrepareTestEnv(t)
ctx := test.MockContext(t, "user2/repo1/labels/edit")
test.LoadUser(t, ctx, 2)
test.LoadRepo(t, ctx, 1)
@@ -91,7 +92,7 @@ func TestNewLabel(t *testing.T) {
}
func TestUpdateLabel(t *testing.T) {
- db.PrepareTestEnv(t)
+ unittest.PrepareTestEnv(t)
ctx := test.MockContext(t, "user2/repo1/labels/edit")
test.LoadUser(t, ctx, 2)
test.LoadRepo(t, ctx, 1)
@@ -111,7 +112,7 @@ func TestUpdateLabel(t *testing.T) {
}
func TestDeleteLabel(t *testing.T) {
- db.PrepareTestEnv(t)
+ unittest.PrepareTestEnv(t)
ctx := test.MockContext(t, "user2/repo1/labels/delete")
test.LoadUser(t, ctx, 2)
test.LoadRepo(t, ctx, 1)
@@ -124,7 +125,7 @@ func TestDeleteLabel(t *testing.T) {
}
func TestUpdateIssueLabel_Clear(t *testing.T) {
- db.PrepareTestEnv(t)
+ unittest.PrepareTestEnv(t)
ctx := test.MockContext(t, "user2/repo1/issues/labels")
test.LoadUser(t, ctx, 2)
test.LoadRepo(t, ctx, 1)
@@ -149,7 +150,7 @@ func TestUpdateIssueLabel_Toggle(t *testing.T) {
{"toggle", []int64{1, 3}, 1, false},
{"toggle", []int64{1, 2}, 2, true},
} {
- db.PrepareTestEnv(t)
+ unittest.PrepareTestEnv(t)
ctx := test.MockContext(t, "user2/repo1/issues/labels")
test.LoadUser(t, ctx, 2)
test.LoadRepo(t, ctx, 1)