summaryrefslogtreecommitdiffstats
path: root/services/issue/label_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'services/issue/label_test.go')
-rw-r--r--services/issue/label_test.go17
1 files changed, 8 insertions, 9 deletions
diff --git a/services/issue/label_test.go b/services/issue/label_test.go
index 758ef98b27..fa6ad613b6 100644
--- a/services/issue/label_test.go
+++ b/services/issue/label_test.go
@@ -8,7 +8,6 @@ import (
"testing"
"code.gitea.io/gitea/models"
- "code.gitea.io/gitea/models/db"
"code.gitea.io/gitea/models/unittest"
"github.com/stretchr/testify/assert"
)
@@ -26,15 +25,15 @@ func TestIssue_AddLabels(t *testing.T) {
}
for _, test := range tests {
assert.NoError(t, unittest.PrepareTestDatabase())
- issue := db.AssertExistsAndLoadBean(t, &models.Issue{ID: test.issueID}).(*models.Issue)
+ issue := unittest.AssertExistsAndLoadBean(t, &models.Issue{ID: test.issueID}).(*models.Issue)
labels := make([]*models.Label, len(test.labelIDs))
for i, labelID := range test.labelIDs {
- labels[i] = db.AssertExistsAndLoadBean(t, &models.Label{ID: labelID}).(*models.Label)
+ labels[i] = unittest.AssertExistsAndLoadBean(t, &models.Label{ID: labelID}).(*models.Label)
}
- doer := db.AssertExistsAndLoadBean(t, &models.User{ID: test.doerID}).(*models.User)
+ doer := unittest.AssertExistsAndLoadBean(t, &models.User{ID: test.doerID}).(*models.User)
assert.NoError(t, AddLabels(issue, doer, labels))
for _, labelID := range test.labelIDs {
- db.AssertExistsAndLoadBean(t, &models.IssueLabel{IssueID: test.issueID, LabelID: labelID})
+ unittest.AssertExistsAndLoadBean(t, &models.IssueLabel{IssueID: test.issueID, LabelID: labelID})
}
}
}
@@ -52,10 +51,10 @@ func TestIssue_AddLabel(t *testing.T) {
}
for _, test := range tests {
assert.NoError(t, unittest.PrepareTestDatabase())
- issue := db.AssertExistsAndLoadBean(t, &models.Issue{ID: test.issueID}).(*models.Issue)
- label := db.AssertExistsAndLoadBean(t, &models.Label{ID: test.labelID}).(*models.Label)
- doer := db.AssertExistsAndLoadBean(t, &models.User{ID: test.doerID}).(*models.User)
+ issue := unittest.AssertExistsAndLoadBean(t, &models.Issue{ID: test.issueID}).(*models.Issue)
+ label := unittest.AssertExistsAndLoadBean(t, &models.Label{ID: test.labelID}).(*models.Label)
+ doer := unittest.AssertExistsAndLoadBean(t, &models.User{ID: test.doerID}).(*models.User)
assert.NoError(t, AddLabel(issue, doer, label))
- db.AssertExistsAndLoadBean(t, &models.IssueLabel{IssueID: test.issueID, LabelID: test.labelID})
+ unittest.AssertExistsAndLoadBean(t, &models.IssueLabel{IssueID: test.issueID, LabelID: test.labelID})
}
}