summaryrefslogtreecommitdiff
path: root/testrig/db.go
diff options
context:
space:
mode:
Diffstat (limited to 'testrig/db.go')
-rw-r--r--testrig/db.go9
1 files changed, 8 insertions, 1 deletions
diff --git a/testrig/db.go b/testrig/db.go
index 6670b91db..508f10b76 100644
--- a/testrig/db.go
+++ b/testrig/db.go
@@ -28,6 +28,7 @@ import (
"github.com/superseriousbusiness/gotosocial/internal/db/bundb"
"github.com/superseriousbusiness/gotosocial/internal/gtsmodel"
"github.com/superseriousbusiness/gotosocial/internal/log"
+ "github.com/superseriousbusiness/gotosocial/internal/state"
)
var testModels = []interface{}{
@@ -92,10 +93,16 @@ func NewTestDB() db.DB {
})
}
- testDB, err := bundb.NewBunDBService(context.Background())
+ var state state.State
+ state.Caches.Init()
+
+ testDB, err := bundb.NewBunDBService(context.Background(), &state)
if err != nil {
log.Panic(err)
}
+
+ state.DB = testDB
+
return testDB
}