mirror of
https://github.com/astaxie/beego.git
synced 2024-11-22 18:10:54 +00:00
fix the ORM test case
This commit is contained in:
parent
a069c73b3a
commit
797571c85f
@ -335,7 +335,7 @@ func NewComment() *Comment {
|
||||
}
|
||||
|
||||
type Group struct {
|
||||
GID string `orm:"pk;column(gid);size(32);unique"`
|
||||
ID int `orm:"column(gid);size(32)"`
|
||||
Name string
|
||||
Permissions []*Permission `orm:"reverse(many)" json:"-"`
|
||||
}
|
||||
|
@ -663,12 +663,10 @@ The program—and web server—godoc processes Go source files to extract docume
|
||||
|
||||
groups := []*Group{
|
||||
{
|
||||
GID: "g1",
|
||||
Name: "admins",
|
||||
Permissions: []*Permission{permissions[0], permissions[1], permissions[2]},
|
||||
},
|
||||
{
|
||||
GID: "g2",
|
||||
Name: "users",
|
||||
Permissions: []*Permission{permissions[1], permissions[2]},
|
||||
},
|
||||
@ -683,7 +681,7 @@ The program—and web server—godoc processes Go source files to extract docume
|
||||
for _, group := range groups {
|
||||
_, err := dORM.Insert(group)
|
||||
throwFail(t, err)
|
||||
//throwFail(t, AssertIs(id > 0, true))
|
||||
throwFail(t, AssertIs(id > 0, true))
|
||||
|
||||
num := len(group.Permissions)
|
||||
if num > 0 {
|
||||
|
Loading…
Reference in New Issue
Block a user