1
0
mirror of https://github.com/astaxie/beego.git synced 2025-07-03 17:10:18 +00:00

orm add GetDB api #433

This commit is contained in:
slene
2014-03-10 20:50:54 +08:00
committed by asta.xie
parent cacdb3228d
commit d5b5c18cf9
2 changed files with 27 additions and 2 deletions

View File

@ -139,6 +139,15 @@ func throwFailNow(t *testing.T, err error, args ...interface{}) {
}
}
func TestGetDB(t *testing.T) {
if db, err := GetDB(); err != nil {
throwFailNow(t, err)
} else {
err = db.Ping()
throwFailNow(t, err)
}
}
func TestSyncDb(t *testing.T) {
RegisterModel(new(Data), new(DataNull))
RegisterModel(new(User))