[fix] model.EashSave string type primary key bug
This commit is contained in:
parent
3734799968
commit
0f854b0e08
1 changed files with 11 additions and 15 deletions
|
|
@ -228,22 +228,18 @@ func TestTableProcessDeleteIn(t *testing.T) {
|
|||
},
|
||||
}
|
||||
process := gou.NewProcess("xiang.table.Save", args...)
|
||||
response := ProcessSave(process)
|
||||
assert.NotNil(t, response)
|
||||
assert.True(t, any.Of(response).IsInt())
|
||||
id := ProcessSave(process)
|
||||
assert.NotNil(t, id)
|
||||
assert.True(t, any.Of(id).IsNumber())
|
||||
|
||||
id := any.Of(response).CInt()
|
||||
args = []interface{}{
|
||||
"service",
|
||||
any.Of(response).Int(),
|
||||
"id",
|
||||
}
|
||||
// id := any.Of(response).CInt()
|
||||
args = []interface{}{"service", id, "id"}
|
||||
process = gou.NewProcess("xiang.table.DeleteIn", args...)
|
||||
response = ProcessDeleteIn(process)
|
||||
id = ProcessDeleteIn(process)
|
||||
|
||||
assert.NotNil(t, response)
|
||||
assert.True(t, any.Of(response).IsInt())
|
||||
assert.Equal(t, any.Of(response).CInt(), 1)
|
||||
assert.NotNil(t, id)
|
||||
assert.True(t, any.Of(id).IsNumber())
|
||||
assert.Equal(t, id, 1)
|
||||
|
||||
// 清空数据
|
||||
capsule.Query().Table("service").Where("id", id).Delete()
|
||||
|
|
@ -403,12 +399,12 @@ func TestTableProcessQuickSave(t *testing.T) {
|
|||
"query": map[string]interface{}{"manu_id": 1},
|
||||
})
|
||||
res := process.Run()
|
||||
newID, ok := res.([]int)
|
||||
newID, ok := res.([]interface{})
|
||||
assert.True(t, ok)
|
||||
assert.NotEqual(t, id, newID[0])
|
||||
|
||||
// 清空数据
|
||||
capsule.Query().Table("service").WhereIn("id", []int{id, newID[0]}).Delete()
|
||||
capsule.Query().Table("service").WhereIn("id", []interface{}{id, newID[0]}).Delete()
|
||||
}
|
||||
|
||||
func TestTableProcessSelect(t *testing.T) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue