mirror of
https://github.com/geektutu/7days-golang.git
synced 2024-04-21 12:32:11 +00:00
19 lines
312 B
Go
19 lines
312 B
Go
package session
|
|
|
|
import (
|
|
"testing"
|
|
)
|
|
|
|
type User struct {
|
|
Name string `geeorm:"primary_key"`
|
|
Age int
|
|
}
|
|
|
|
func TestSession_CreateTable(t *testing.T) {
|
|
_ = NewSession().DropTable(&User{})
|
|
_ = NewSession().CreateTable(&User{})
|
|
if !NewSession().HasTable("User") {
|
|
t.Fatal("failed to create table User")
|
|
}
|
|
}
|