summaryrefslogtreecommitdiffstats
path: root/models/main_test.go
diff options
context:
space:
mode:
authorwxiaoguang <wxiaoguang@gmail.com>2021-11-12 22:36:47 +0800
committerGitHub <noreply@github.com>2021-11-12 22:36:47 +0800
commitdf64fa486555de6f403a795fd16c2e9e1d59e535 (patch)
treeb899e9b9e5d57409b1bf0e3afbd606b6a3900235 /models/main_test.go
parent7f802631c54d2e91301158380b273b872d62bd80 (diff)
downloadgitea-df64fa486555de6f403a795fd16c2e9e1d59e535.tar.gz
gitea-df64fa486555de6f403a795fd16c2e9e1d59e535.zip
Decouple unit test code from business code (#17623)
Diffstat (limited to 'models/main_test.go')
-rw-r--r--models/main_test.go16
1 files changed, 12 insertions, 4 deletions
diff --git a/models/main_test.go b/models/main_test.go
index ad9276330f..15bece7bf4 100644
--- a/models/main_test.go
+++ b/models/main_test.go
@@ -7,17 +7,25 @@ package models
import (
"testing"
- "code.gitea.io/gitea/models/db"
+ "code.gitea.io/gitea/models/unittest"
"github.com/stretchr/testify/assert"
)
// TestFixturesAreConsistent assert that test fixtures are consistent
func TestFixturesAreConsistent(t *testing.T) {
- assert.NoError(t, db.PrepareTestDatabase())
- CheckConsistencyForAll(t)
+ assert.NoError(t, unittest.PrepareTestDatabase())
+ CheckConsistencyFor(t,
+ &User{},
+ &Repository{},
+ &Issue{},
+ &PullRequest{},
+ &Milestone{},
+ &Label{},
+ &Team{},
+ &Action{})
}
func TestMain(m *testing.M) {
- db.MainTest(m, "..")
+ unittest.MainTest(m, "..")
}