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 975B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. // Copyright 2020 The Gitea Authors. All rights reserved.
  2. // SPDX-License-Identifier: MIT
  3. package models
  4. import (
  5. "testing"
  6. activities_model "code.gitea.io/gitea/models/activities"
  7. "code.gitea.io/gitea/models/organization"
  8. repo_model "code.gitea.io/gitea/models/repo"
  9. "code.gitea.io/gitea/models/unittest"
  10. user_model "code.gitea.io/gitea/models/user"
  11. "code.gitea.io/gitea/modules/setting"
  12. _ "code.gitea.io/gitea/models/system"
  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. &organization.Team{},
  26. &activities_model.Action{})
  27. }
  28. func TestMain(m *testing.M) {
  29. unittest.MainTest(m, &unittest.TestOptions{
  30. GiteaRootPath: "..",
  31. })
  32. }