mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-04-19 05:29:18 +00:00
- When looking for an existing blob, has_blake2b will be null when it was created prior to v26 migration in v11, when the field was introduced. - Add unit test and minimal refactoring to load fixtures. The AddFixture function should not be where it currently is because it cannot be used by some packages (circular import). But that's a refactor that needs to be elsewhere for backporting purposes. Fixes https://codeberg.org/forgejo/forgejo/issues/7519 Co-authored-by: Earl Warren <contact@earl-warren.org> Co-committed-by: Earl Warren <contact@earl-warren.org>
31 lines
617 B
Go
31 lines
617 B
Go
// Copyright 2020 The Gitea Authors. All rights reserved.
|
|
// SPDX-License-Identifier: MIT
|
|
|
|
package packages
|
|
|
|
import (
|
|
"path/filepath"
|
|
"testing"
|
|
|
|
"forgejo.org/models/unittest"
|
|
"forgejo.org/modules/setting"
|
|
|
|
_ "forgejo.org/models"
|
|
_ "forgejo.org/models/actions"
|
|
_ "forgejo.org/models/activities"
|
|
_ "forgejo.org/models/forgefed"
|
|
)
|
|
|
|
func AddFixtures(dirs ...string) func() {
|
|
return unittest.OverrideFixtures(
|
|
unittest.FixturesOptions{
|
|
Dir: filepath.Join(setting.AppWorkPath, "models/fixtures/"),
|
|
Base: setting.AppWorkPath,
|
|
Dirs: dirs,
|
|
},
|
|
)
|
|
}
|
|
|
|
func TestMain(m *testing.M) {
|
|
unittest.MainTest(m)
|
|
}
|