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.

main_test.go 1.0KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. // Copyright 2020 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. "testing"
  7. issues_model "code.gitea.io/gitea/models/issues"
  8. "code.gitea.io/gitea/models/organization"
  9. repo_model "code.gitea.io/gitea/models/repo"
  10. "code.gitea.io/gitea/models/unittest"
  11. user_model "code.gitea.io/gitea/models/user"
  12. "code.gitea.io/gitea/modules/setting"
  13. "github.com/stretchr/testify/assert"
  14. )
  15. func init() {
  16. setting.SetCustomPathAndConf("", "", "")
  17. setting.LoadForTest()
  18. }
  19. // TestFixturesAreConsistent assert that test fixtures are consistent
  20. func TestFixturesAreConsistent(t *testing.T) {
  21. assert.NoError(t, unittest.PrepareTestDatabase())
  22. unittest.CheckConsistencyFor(t,
  23. &user_model.User{},
  24. &repo_model.Repository{},
  25. &Issue{},
  26. &PullRequest{},
  27. &issues_model.Milestone{},
  28. &Label{},
  29. &organization.Team{},
  30. &Action{})
  31. }
  32. func TestMain(m *testing.M) {
  33. unittest.MainTest(m, &unittest.TestOptions{
  34. GiteaRootPath: "..",
  35. })
  36. }