forked from forgejo/forgejo
[TESTS] tests.AddFixtures helper loads additional per-test fixtures
(cherry picked from commit93a844dd13
) (cherry picked from commit6d6d1a121c
)
This commit is contained in:
parent
64e38b3363
commit
34646f9886
3 changed files with 30 additions and 0 deletions
|
@ -267,3 +267,13 @@ func PrintCurrentTest(t testing.TB, skip ...int) func() {
|
|||
func Printf(format string, args ...any) {
|
||||
testlogger.Printf(format, args...)
|
||||
}
|
||||
|
||||
func AddFixtures(dirs ...string) func() {
|
||||
return unittest.OverrideFixtures(
|
||||
unittest.FixturesOptions{
|
||||
Dir: filepath.Join(filepath.Dir(setting.AppPath), "models/fixtures/"),
|
||||
Base: filepath.Dir(setting.AppPath),
|
||||
Dirs: dirs,
|
||||
},
|
||||
)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue