This commit is contained in:
Lunny Xiao 2021-06-09 16:59:22 +08:00
parent 54ec855eca
commit b070bda8ff
1 changed files with 2 additions and 2 deletions

View File

@ -792,7 +792,7 @@ func TestNoUpdate(t *testing.T) {
_, err = testEngine.ID(1).Update(&NoUpdate{}) _, err = testEngine.ID(1).Update(&NoUpdate{})
assert.Error(t, err) assert.Error(t, err)
assert.EqualValues(t, "No content found to be updated", err.Error()) assert.EqualValues(t, xorm.ErrNoColumnsTobeUpdated, err.Error())
} }
func TestNewUpdate(t *testing.T) { func TestNewUpdate(t *testing.T) {
@ -922,7 +922,7 @@ func TestDeletedUpdate(t *testing.T) {
assert.EqualValues(t, 1, cnt) assert.EqualValues(t, 1, cnt)
cnt, err = testEngine.ID(s.Id).Cols("deleted_at").Update(&DeletedUpdatedStruct{}) cnt, err = testEngine.ID(s.Id).Cols("deleted_at").Update(&DeletedUpdatedStruct{})
assert.EqualValues(t, "No content found to be updated", err.Error()) assert.EqualValues(t, xorm.ErrNoColumnsTobeUpdated, err.Error())
assert.EqualValues(t, 0, cnt) assert.EqualValues(t, 0, cnt)
cnt, err = testEngine.ID(s.Id).Unscoped().Cols("deleted_at").Update(&DeletedUpdatedStruct{}) cnt, err = testEngine.ID(s.Id).Unscoped().Cols("deleted_at").Update(&DeletedUpdatedStruct{})