diff options
Diffstat (limited to 'models/unit_tests.go')
-rw-r--r-- | models/unit_tests.go | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/models/unit_tests.go b/models/unit_tests.go index dca363ffac..11b7708ffd 100644 --- a/models/unit_tests.go +++ b/models/unit_tests.go @@ -15,6 +15,7 @@ import ( "code.gitea.io/gitea/modules/base" "code.gitea.io/gitea/modules/setting" + "code.gitea.io/gitea/modules/storage" "code.gitea.io/gitea/modules/util" "github.com/stretchr/testify/assert" @@ -67,6 +68,11 @@ func MainTest(m *testing.M, pathToGiteaRoot string) { fatalTestError("url.Parse: %v\n", err) } + setting.Attachment.Path = filepath.Join(setting.AppDataPath, "attachments") + if err = storage.Init(); err != nil { + fatalTestError("storage.Init: %v\n", err) + } + if err = util.RemoveAll(setting.RepoRootPath); err != nil { fatalTestError("util.RemoveAll: %v\n", err) } |