Fork to maintain patches against the official gitea for https://code.ceondo.com https://github.com/go-gitea/gitea

test_fixtures.go 613B

123456789101112131415161718192021222324
  1. // Copyright 2017 The Gitea Authors. All rights reserved.
  2. // Use of this source code is governed by a MIT-style
  3. // license that can be found in the LICENSE file.
  4. package models
  5. import (
  6. "gopkg.in/testfixtures.v2"
  7. )
  8. var fixtures *testfixtures.Context
  9. // InitFixtures initialize test fixtures for a test database
  10. func InitFixtures(helper testfixtures.Helper, dir string) (err error) {
  11. testfixtures.SkipDatabaseNameCheck(true)
  12. fixtures, err = testfixtures.NewFolder(x.DB().DB, helper, dir)
  13. return err
  14. }
  15. // LoadFixtures load fixtures for a test database
  16. func LoadFixtures() error {
  17. return fixtures.Load()
  18. }