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

1234567891011121314151617181920212223242526272829303132333435363738
  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. "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. "github.com/stretchr/testify/assert"
  13. )
  14. func init() {
  15. setting.SetCustomPathAndConf("", "", "")
  16. setting.LoadForTest()
  17. }
  18. // TestFixturesAreConsistent assert that test fixtures are consistent
  19. func TestFixturesAreConsistent(t *testing.T) {
  20. assert.NoError(t, unittest.PrepareTestDatabase())
  21. unittest.CheckConsistencyFor(t,
  22. &user_model.User{},
  23. &repo_model.Repository{},
  24. &organization.Team{},
  25. &Action{})
  26. }
  27. func TestMain(m *testing.M) {
  28. unittest.MainTest(m, &unittest.TestOptions{
  29. GiteaRootPath: "..",
  30. })
  31. }