mirror of
https://github.com/astaxie/beego.git
synced 2024-11-22 22:00:55 +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 {
|
type Group struct {
|
||||||
GID string `orm:"pk;column(gid);size(32);unique"`
|
ID int `orm:"column(gid);size(32)"`
|
||||||
Name string
|
Name string
|
||||||
Permissions []*Permission `orm:"reverse(many)" json:"-"`
|
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{
|
groups := []*Group{
|
||||||
{
|
{
|
||||||
GID: "g1",
|
|
||||||
Name: "admins",
|
Name: "admins",
|
||||||
Permissions: []*Permission{permissions[0], permissions[1], permissions[2]},
|
Permissions: []*Permission{permissions[0], permissions[1], permissions[2]},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
GID: "g2",
|
|
||||||
Name: "users",
|
Name: "users",
|
||||||
Permissions: []*Permission{permissions[1], permissions[2]},
|
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 {
|
for _, group := range groups {
|
||||||
_, err := dORM.Insert(group)
|
_, err := dORM.Insert(group)
|
||||||
throwFail(t, err)
|
throwFail(t, err)
|
||||||
//throwFail(t, AssertIs(id > 0, true))
|
throwFail(t, AssertIs(id > 0, true))
|
||||||
|
|
||||||
num := len(group.Permissions)
|
num := len(group.Permissions)
|
||||||
if num > 0 {
|
if num > 0 {
|
||||||
|
Loading…
Reference in New Issue
Block a user