diff options
author | wxiaoguang <wxiaoguang@gmail.com> | 2021-11-16 16:53:21 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-16 16:53:21 +0800 |
commit | 81926d61db3dac223a75ea49eab893b25a089587 (patch) | |
tree | 627d2f19a008089f3a688e9a94a2cc8d2017afe2 /models/issue_list_test.go | |
parent | 23bd7b1211a80aa3b0dcb60ec4a1c0089ff28dd4 (diff) | |
download | gitea-81926d61db3dac223a75ea49eab893b25a089587.tar.gz gitea-81926d61db3dac223a75ea49eab893b25a089587.zip |
Decouple unit test, remove intermediate `unittestbridge` package (#17662)
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Diffstat (limited to 'models/issue_list_test.go')
-rw-r--r-- | models/issue_list_test.go | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/models/issue_list_test.go b/models/issue_list_test.go index ea2f42e77b..2916a7302f 100644 --- a/models/issue_list_test.go +++ b/models/issue_list_test.go @@ -7,7 +7,6 @@ package models import ( "testing" - "code.gitea.io/gitea/models/db" "code.gitea.io/gitea/models/unittest" "code.gitea.io/gitea/modules/setting" @@ -18,9 +17,9 @@ func TestIssueList_LoadRepositories(t *testing.T) { assert.NoError(t, unittest.PrepareTestDatabase()) issueList := IssueList{ - db.AssertExistsAndLoadBean(t, &Issue{ID: 1}).(*Issue), - db.AssertExistsAndLoadBean(t, &Issue{ID: 2}).(*Issue), - db.AssertExistsAndLoadBean(t, &Issue{ID: 4}).(*Issue), + unittest.AssertExistsAndLoadBean(t, &Issue{ID: 1}).(*Issue), + unittest.AssertExistsAndLoadBean(t, &Issue{ID: 2}).(*Issue), + unittest.AssertExistsAndLoadBean(t, &Issue{ID: 4}).(*Issue), } repos, err := issueList.LoadRepositories() @@ -35,8 +34,8 @@ func TestIssueList_LoadAttributes(t *testing.T) { assert.NoError(t, unittest.PrepareTestDatabase()) setting.Service.EnableTimetracking = true issueList := IssueList{ - db.AssertExistsAndLoadBean(t, &Issue{ID: 1}).(*Issue), - db.AssertExistsAndLoadBean(t, &Issue{ID: 4}).(*Issue), + unittest.AssertExistsAndLoadBean(t, &Issue{ID: 1}).(*Issue), + unittest.AssertExistsAndLoadBean(t, &Issue{ID: 4}).(*Issue), } assert.NoError(t, issueList.LoadAttributes()) @@ -44,7 +43,7 @@ func TestIssueList_LoadAttributes(t *testing.T) { assert.EqualValues(t, issue.RepoID, issue.Repo.ID) for _, label := range issue.Labels { assert.EqualValues(t, issue.RepoID, label.RepoID) - db.AssertExistsAndLoadBean(t, &IssueLabel{IssueID: issue.ID, LabelID: label.ID}) + unittest.AssertExistsAndLoadBean(t, &IssueLabel{IssueID: issue.ID, LabelID: label.ID}) } if issue.PosterID > 0 { assert.EqualValues(t, issue.PosterID, issue.Poster.ID) |