summaryrefslogtreecommitdiff
path: root/testrig/db.go
diff options
context:
space:
mode:
authorLibravatar tobi <31960611+tsmethurst@users.noreply.github.com>2023-01-10 15:19:05 +0100
committerLibravatar GitHub <noreply@github.com>2023-01-10 14:19:05 +0000
commitd6487933c758be647bff7a568d6a33e6155e6599 (patch)
treefbc2d466dc2d0833a7ceec1200643e78dae4f916 /testrig/db.go
parent[chore] Bump json5 from 1.0.1 to 1.0.2 in /web/source (#1308) (diff)
downloadgotosocial-d6487933c758be647bff7a568d6a33e6155e6599.tar.xz
[feature] Implement Report database model and utility functions (#1310)
* implement report database model * implement report cache + config changes * implement report database functions * report uri / regex functions * update envparsing test * remove unnecessary uri index * remove unused function + cache lookup * process error when storing report
Diffstat (limited to 'testrig/db.go')
-rw-r--r--testrig/db.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/testrig/db.go b/testrig/db.go
index ed9c1b916..4304050cf 100644
--- a/testrig/db.go
+++ b/testrig/db.go
@@ -58,6 +58,7 @@ var testModels = []interface{}{
&gtsmodel.Client{},
&gtsmodel.EmojiCategory{},
&gtsmodel.Tombstone{},
+ &gtsmodel.Report{},
}
// NewTestDB returns a new initialized, empty database for testing.
@@ -157,6 +158,12 @@ func StandardDBSetup(db db.DB, accounts map[string]*gtsmodel.Account) {
}
}
+ for _, v := range NewTestReports() {
+ if err := db.Put(ctx, v); err != nil {
+ log.Panic(err)
+ }
+ }
+
for _, v := range NewTestDomainBlocks() {
if err := db.Put(ctx, v); err != nil {
log.Panic(err)