Skip to content

Commit

Permalink
e2e: add tests for GetIDFromSingleResult
Browse files Browse the repository at this point in the history
Signed-off-by: scnace <[email protected]>
  • Loading branch information
scbizu committed May 13, 2024
1 parent ef69477 commit 602dec7
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion e2e/mongo/user/user_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,13 @@ func TestFindAndSave(t *testing.T) {
user.UserMgoFieldUsername: "username_1",
})
assert.NoError(t, err)
_, err = orm.GetIDFromSingleResult(res)
oid, err := orm.GetIDFromSingleResult(res)
assert.NoError(t, err)
u, err := user.Get_UserMgr().FindOne(ctx, bson.M{
user.UserMgoFieldUsername: "username_1_new",
}, nil)
assert.NoError(t, err)
assert.Equal(t, u.ID.Hex(), oid)
}

func TestInsertUnique(t *testing.T) {
Expand Down

0 comments on commit 602dec7

Please sign in to comment.