Decouple unit test code from business code (#17623)
This commit is contained in:
parent
7f802631c5
commit
df64fa4865
136 changed files with 1058 additions and 830 deletions
|
@ -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, "..")
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue