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:
@ -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))
|
||||
|
Reference in New Issue
Block a user