From 4649ddbae25448206656a02c159a8f1f71491d9e Mon Sep 17 00:00:00 2001 From: HFO4 <912394456@qq.com> Date: Mon, 9 Dec 2019 19:45:04 +0800 Subject: [PATCH] Fix: failed uint test due to dirty cache --- models/setting_test.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/models/setting_test.go b/models/setting_test.go index 6c5afb5..c4ebe99 100644 --- a/models/setting_test.go +++ b/models/setting_test.go @@ -3,6 +3,7 @@ package model import ( "database/sql" "github.com/DATA-DOG/go-sqlmock" + "github.com/HFO4/cloudreve/pkg/cache" "github.com/jinzhu/gorm" "github.com/stretchr/testify/assert" "testing" @@ -26,6 +27,7 @@ func TestMain(m *testing.M) { } func TestGetSettingByType(t *testing.T) { + cache.Store = cache.NewMemoStore() asserts := assert.New(t) //找到设置时 @@ -57,6 +59,7 @@ func TestGetSettingByType(t *testing.T) { } func TestGetSettingByNames(t *testing.T) { + cache.Store = cache.NewMemoStore() asserts := assert.New(t) //找到设置时 @@ -102,6 +105,7 @@ func TestGetSettingByNames(t *testing.T) { // TestGetSettingByName 测试GetSettingByName func TestGetSettingByName(t *testing.T) { + cache.Store = cache.NewMemoStore() asserts := assert.New(t) //找到设置时