modify test case

This commit is contained in:
YongAn 2022-06-04 21:24:46 +08:00
parent 7d199fae3f
commit cb87bc0161
3 changed files with 5 additions and 6 deletions

View File

@ -199,7 +199,7 @@ func TestShadowCacheDelete(t *testing.T) {
assert.NoError(t, err) assert.NoError(t, err)
testEngine.ShowSQL(true) testEngine.ShowSQL(true)
_, err = testEngine.NewSession().Exec("CREATE DATABASE IF NOT EXISTS shadow_test") _, err = testEngine.NewSession().Exec("CREATE DATABASE IF NOT EXISTS shadow_test")
testEngine.SetShadow(dialects.NewTrueShadow()) testEngine.SetShadow(dialects.NewFalseShadow())
oldCacher := testEngine.GetDefaultCacher() oldCacher := testEngine.GetDefaultCacher()
cacher := caches.NewLRUCacher(caches.NewMemoryStore(), 1000) cacher := caches.NewLRUCacher(caches.NewMemoryStore(), 1000)

View File

@ -38,7 +38,7 @@ func TestShadowGetVar(t *testing.T) {
Money float32 Money float32
Created time.Time `xorm:"created"` Created time.Time `xorm:"created"`
} }
testEngine.SetShadow(dialects.NewTrueShadow()) testEngine.SetShadow(dialects.NewFalseShadow())
assert.NoError(t, testEngine.Context(context.Background()).Sync(new(GetVar))) assert.NoError(t, testEngine.Context(context.Background()).Sync(new(GetVar)))

View File

@ -7,13 +7,12 @@ package integrations
import ( import (
"context" "context"
"fmt" "fmt"
"github.com/stretchr/testify/assert"
"sync" "sync"
"testing" "testing"
"time" "time"
"xorm.io/xorm/dialects"
"github.com/stretchr/testify/assert"
"xorm.io/xorm" "xorm.io/xorm"
"xorm.io/xorm/dialects"
"xorm.io/xorm/internal/statements" "xorm.io/xorm/internal/statements"
"xorm.io/xorm/internal/utils" "xorm.io/xorm/internal/utils"
"xorm.io/xorm/names" "xorm.io/xorm/names"
@ -1478,7 +1477,7 @@ func TestShadowUpdate1(t *testing.T) {
assert.NoError(t, err) assert.NoError(t, err)
testEngine.ShowSQL(true) testEngine.ShowSQL(true)
_, err = testEngine.NewSession().Exec("CREATE DATABASE IF NOT EXISTS shadow_test") _, err = testEngine.NewSession().Exec("CREATE DATABASE IF NOT EXISTS shadow_test")
testEngine.SetShadow(dialects.NewTrueShadow()) testEngine.SetShadow(dialects.NewFalseShadow())
assert.NoError(t, testEngine.Context(context.Background()).Sync(&Userinfo{})) assert.NoError(t, testEngine.Context(context.Background()).Sync(&Userinfo{}))
_, err = testEngine.Insert(&Userinfo{ _, err = testEngine.Insert(&Userinfo{