mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-10-29 05:21:04 +00:00
[TESTS] tests.AddFixtures helper loads additional per-test fixtures
(cherry picked from commit93a844dd13) (cherry picked from commit6d6d1a121c) (cherry picked from commit8b101f2860) (cherry picked from commit3e56212d6d) (cherry picked from commit4f619bc585) (cherry picked from commit06a47ea56e) (cherry picked from commit5a4d56e77b) (cherry picked from commit84b9d3a0c3) (cherry picked from commit1eb2eca71c) (cherry picked from commit11d0fe5400) (cherry picked from commitc93b8b9d3c)
This commit is contained in:
parent
1d16607db5
commit
679a7e2efa
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