diff options
Diffstat (limited to 'models/admin_test.go')
-rw-r--r-- | models/admin_test.go | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/models/admin_test.go b/models/admin_test.go index 316ed5cb68..ea060f9726 100644 --- a/models/admin_test.go +++ b/models/admin_test.go @@ -8,6 +8,7 @@ import ( "testing" "code.gitea.io/gitea/models/db" + "code.gitea.io/gitea/models/unittest" "github.com/stretchr/testify/assert" ) @@ -20,7 +21,7 @@ func TestNotice_TrStr(t *testing.T) { } func TestCreateNotice(t *testing.T) { - assert.NoError(t, db.PrepareTestDatabase()) + assert.NoError(t, unittest.PrepareTestDatabase()) noticeBean := &Notice{ Type: NoticeRepository, @@ -32,7 +33,7 @@ func TestCreateNotice(t *testing.T) { } func TestCreateRepositoryNotice(t *testing.T) { - assert.NoError(t, db.PrepareTestDatabase()) + assert.NoError(t, unittest.PrepareTestDatabase()) noticeBean := &Notice{ Type: NoticeRepository, @@ -46,12 +47,12 @@ func TestCreateRepositoryNotice(t *testing.T) { // TODO TestRemoveAllWithNotice func TestCountNotices(t *testing.T) { - assert.NoError(t, db.PrepareTestDatabase()) + assert.NoError(t, unittest.PrepareTestDatabase()) assert.Equal(t, int64(3), CountNotices()) } func TestNotices(t *testing.T) { - assert.NoError(t, db.PrepareTestDatabase()) + assert.NoError(t, unittest.PrepareTestDatabase()) notices, err := Notices(1, 2) assert.NoError(t, err) @@ -68,7 +69,7 @@ func TestNotices(t *testing.T) { } func TestDeleteNotice(t *testing.T) { - assert.NoError(t, db.PrepareTestDatabase()) + assert.NoError(t, unittest.PrepareTestDatabase()) db.AssertExistsAndLoadBean(t, &Notice{ID: 3}) assert.NoError(t, DeleteNotice(3)) @@ -77,7 +78,7 @@ func TestDeleteNotice(t *testing.T) { func TestDeleteNotices(t *testing.T) { // delete a non-empty range - assert.NoError(t, db.PrepareTestDatabase()) + assert.NoError(t, unittest.PrepareTestDatabase()) db.AssertExistsAndLoadBean(t, &Notice{ID: 1}) db.AssertExistsAndLoadBean(t, &Notice{ID: 2}) @@ -90,7 +91,7 @@ func TestDeleteNotices(t *testing.T) { func TestDeleteNotices2(t *testing.T) { // delete an empty range - assert.NoError(t, db.PrepareTestDatabase()) + assert.NoError(t, unittest.PrepareTestDatabase()) db.AssertExistsAndLoadBean(t, &Notice{ID: 1}) db.AssertExistsAndLoadBean(t, &Notice{ID: 2}) @@ -102,7 +103,7 @@ func TestDeleteNotices2(t *testing.T) { } func TestDeleteNoticesByIDs(t *testing.T) { - assert.NoError(t, db.PrepareTestDatabase()) + assert.NoError(t, unittest.PrepareTestDatabase()) db.AssertExistsAndLoadBean(t, &Notice{ID: 1}) db.AssertExistsAndLoadBean(t, &Notice{ID: 2}) |