mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-11-29 07:47:52 +01:00
[TESTS] enable AddFixtures in unit tests
Use setting.AppWorkPath instead of filepath.Dir(setting.AppPath). It is the common denominator between: * models/unittest/testdb.go:MainTest * tests/test_utils.go:InitTest which makes it usable in unit tests as well as integration tests.
This commit is contained in:
parent
3f68525ae4
commit
ad547edf3b
1 changed files with 2 additions and 2 deletions
|
@ -271,8 +271,8 @@ func Printf(format string, args ...any) {
|
||||||
func AddFixtures(dirs ...string) func() {
|
func AddFixtures(dirs ...string) func() {
|
||||||
return unittest.OverrideFixtures(
|
return unittest.OverrideFixtures(
|
||||||
unittest.FixturesOptions{
|
unittest.FixturesOptions{
|
||||||
Dir: filepath.Join(filepath.Dir(setting.AppPath), "models/fixtures/"),
|
Dir: filepath.Join(setting.AppWorkPath, "models/fixtures/"),
|
||||||
Base: filepath.Dir(setting.AppPath),
|
Base: setting.AppWorkPath,
|
||||||
Dirs: dirs,
|
Dirs: dirs,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in a new issue