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

orm test add extra custom JsonField

This commit is contained in:
slene
2013-11-26 21:34:40 +08:00
parent bcc8f60677
commit 690d77e985
2 changed files with 39 additions and 3 deletions

View File

@ -478,7 +478,9 @@ func TestCustomField(t *testing.T) {
throwFailNow(t, err)
user.Langs = append(user.Langs, "zh-CN", "en-US")
_, err = dORM.Update(&user, "Langs")
user.Extra.Name = "beego"
user.Extra.Data = "orm"
_, err = dORM.Update(&user, "Langs", "Extra")
throwFailNow(t, err)
user = User{Id: 2}
@ -487,6 +489,9 @@ func TestCustomField(t *testing.T) {
throwFailNow(t, AssertIs(len(user.Langs), 2))
throwFailNow(t, AssertIs(user.Langs[0], "zh-CN"))
throwFailNow(t, AssertIs(user.Langs[1], "en-US"))
throwFailNow(t, AssertIs(user.Extra.Name, "beego"))
throwFailNow(t, AssertIs(user.Extra.Data, "orm"))
}
func TestExpr(t *testing.T) {