diff options
author | wxiaoguang <wxiaoguang@gmail.com> | 2021-11-16 09:53:21 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-16 09:53:21 +0100 |
commit | 81926d61db3dac223a75ea49eab893b25a089587 (patch) | |
tree | 627d2f19a008089f3a688e9a94a2cc8d2017afe2 /services/gitdiff | |
parent | Add copy button to markdown code blocks (#17638) (diff) | |
download | forgejo-81926d61db3dac223a75ea49eab893b25a089587.tar.xz forgejo-81926d61db3dac223a75ea49eab893b25a089587.zip |
Decouple unit test, remove intermediate `unittestbridge` package (#17662)
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Diffstat (limited to 'services/gitdiff')
-rw-r--r-- | services/gitdiff/gitdiff_test.go | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/services/gitdiff/gitdiff_test.go b/services/gitdiff/gitdiff_test.go index 359e2e8c66..aefd396ebb 100644 --- a/services/gitdiff/gitdiff_test.go +++ b/services/gitdiff/gitdiff_test.go @@ -13,7 +13,6 @@ import ( "testing" "code.gitea.io/gitea/models" - "code.gitea.io/gitea/models/db" "code.gitea.io/gitea/models/unittest" "code.gitea.io/gitea/modules/git" "code.gitea.io/gitea/modules/highlight" @@ -496,8 +495,8 @@ func setupDefaultDiff() *Diff { func TestDiff_LoadComments(t *testing.T) { assert.NoError(t, unittest.PrepareTestDatabase()) - issue := db.AssertExistsAndLoadBean(t, &models.Issue{ID: 2}).(*models.Issue) - user := db.AssertExistsAndLoadBean(t, &models.User{ID: 1}).(*models.User) + issue := unittest.AssertExistsAndLoadBean(t, &models.Issue{ID: 2}).(*models.Issue) + user := unittest.AssertExistsAndLoadBean(t, &models.User{ID: 1}).(*models.User) diff := setupDefaultDiff() assert.NoError(t, diff.LoadComments(issue, user)) assert.Len(t, diff.Files[0].Sections[0].Lines[0].Comments, 2) |