fix tests

This commit is contained in:
Lunny Xiao 2019-03-13 21:35:49 +08:00
parent ba83909d2d
commit 372ece5469
No known key found for this signature in database
GPG Key ID: C3B7C91B632F738A
1 changed files with 5 additions and 2 deletions

View File

@ -81,7 +81,9 @@ func TestCols(t *testing.T) {
assert.NoError(t, err) assert.NoError(t, err)
sess := testEngine.ID(1) sess := testEngine.ID(1)
_, err = sess.Cols("col1").Cols("col2").Update(&ColsTable{ col1Name := mapper.Obj2Table("Col1")
col2Name := mapper.Obj2Table("Col2")
_, err = sess.Cols(col1Name).Cols(col2Name).Update(&ColsTable{
Col1: "", Col1: "",
Col2: "", Col2: "",
}) })
@ -130,7 +132,8 @@ func TestMustCol(t *testing.T) {
} }
customer.ParentId = 0 customer.ParentId = 0
affected, err := testEngine.MustCols("parent_id").Update(&customer, &CustomerOnlyId{Id: customer.Id}) parentIDName := mapper.Obj2Table("ParentId")
affected, err := testEngine.MustCols(parentIDName).Update(&customer, &CustomerOnlyId{Id: customer.Id})
assert.NoError(t, err) assert.NoError(t, err)
assert.EqualValues(t, 1, affected) assert.EqualValues(t, 1, affected)
} }