improve tests (#1206)

This commit is contained in:
Lunny Xiao 2019-01-23 16:11:07 +08:00 committed by GitHub
parent ff094ebc3e
commit 0d2c78dab6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 4 deletions

View File

@ -24,10 +24,7 @@ func TestQueryContext(t *testing.T) {
_, err := testEngine.Insert(&ContextQueryStruct{Name: "1"})
assert.NoError(t, err)
sess := testEngine.NewSession()
defer sess.Close()
ctx, cancel := context.WithTimeout(context.Background(), time.Microsecond)
ctx, cancel := context.WithTimeout(context.Background(), time.Nanosecond)
defer cancel()
has, err := testEngine.Context(ctx).Exist(&ContextQueryStruct{Name: "1"})
assert.Error(t, err)