Skip to content
This repository has been archived by the owner on Sep 7, 2021. It is now read-only.
This repository is currently being migrated. It's locked while the migration is in progress.

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
lunny committed Sep 26, 2019
1 parent 0902447 commit 24113e5
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions session_find_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -812,11 +812,15 @@ func TestFindMapCols(t *testing.T) {
assert.NoError(t, prepareEngine())
assertSync(t, new(FindMapCols))

id := testEngine.GetColumnMapper().Obj2Table("Id")
colA := testEngine.GetColumnMapper().Obj2Table("ColA")
colB := testEngine.GetColumnMapper().Obj2Table("ColB")

var objs = make(map[int64]*FindMapCols)
err := testEngine.Cols("col_a, col_b").Find(&objs)
err := testEngine.Cols(colA, colB).Find(&objs)
assert.Error(t, err)
assert.True(t, IsErrPrimaryKeyNoSelected(err))

err = testEngine.Cols("id, col_a, col_b").Find(&objs)
err = testEngine.Cols(id, colA, colB).Find(&objs)
assert.NoError(t, err)
}

0 comments on commit 24113e5

Please sign in to comment.