From 81926d61db3dac223a75ea49eab893b25a089587 Mon Sep 17 00:00:00 2001 From: wxiaoguang Date: Tue, 16 Nov 2021 16:53:21 +0800 Subject: Decouple unit test, remove intermediate `unittestbridge` package (#17662) Co-authored-by: Lunny Xiao --- services/gitdiff/gitdiff_test.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'services/gitdiff') 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) -- cgit v1.2.3