You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

23 lines
613 B

  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. }