From df64fa486555de6f403a795fd16c2e9e1d59e535 Mon Sep 17 00:00:00 2001 From: wxiaoguang Date: Fri, 12 Nov 2021 22:36:47 +0800 Subject: Decouple unit test code from business code (#17623) --- integrations/repofiles_delete_test.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'integrations/repofiles_delete_test.go') diff --git a/integrations/repofiles_delete_test.go b/integrations/repofiles_delete_test.go index 22fef4b03e..8150673e2b 100644 --- a/integrations/repofiles_delete_test.go +++ b/integrations/repofiles_delete_test.go @@ -8,8 +8,9 @@ import ( "net/url" "testing" + "code.gitea.io/gitea/models/unittest" + "code.gitea.io/gitea/models" - "code.gitea.io/gitea/models/db" "code.gitea.io/gitea/modules/repofiles" api "code.gitea.io/gitea/modules/structs" "code.gitea.io/gitea/modules/test" @@ -67,7 +68,7 @@ func TestDeleteRepoFile(t *testing.T) { func testDeleteRepoFile(t *testing.T, u *url.URL) { // setup - db.PrepareTestEnv(t) + unittest.PrepareTestEnv(t) ctx := test.MockContext(t, "user2/repo1") ctx.SetParams(":id", "1") test.LoadRepo(t, ctx, 1) @@ -106,7 +107,7 @@ func TestDeleteRepoFileWithoutBranchNames(t *testing.T) { func testDeleteRepoFileWithoutBranchNames(t *testing.T, u *url.URL) { // setup - db.PrepareTestEnv(t) + unittest.PrepareTestEnv(t) ctx := test.MockContext(t, "user2/repo1") ctx.SetParams(":id", "1") test.LoadRepo(t, ctx, 1) @@ -136,7 +137,7 @@ func testDeleteRepoFileWithoutBranchNames(t *testing.T, u *url.URL) { func TestDeleteRepoFileErrors(t *testing.T) { // setup - db.PrepareTestEnv(t) + unittest.PrepareTestEnv(t) ctx := test.MockContext(t, "user2/repo1") ctx.SetParams(":id", "1") test.LoadRepo(t, ctx, 1) -- cgit v1.2.3