diff options
author | 2023-11-08 14:32:17 +0000 | |
---|---|---|
committer | 2023-11-08 14:32:17 +0000 | |
commit | e9e5dc5a40926e5320cb131b035c46b1e1b0bd59 (patch) | |
tree | 52edc9fa5742f28e1e5223f51cda628ec1c35a24 /testrig/db.go | |
parent | [chore]: Bump github.com/spf13/cobra from 1.7.0 to 1.8.0 (#2338) (diff) | |
download | gotosocial-e9e5dc5a40926e5320cb131b035c46b1e1b0bd59.tar.xz |
[feature] add support for polls + receiving federated status edits (#2330)
Diffstat (limited to 'testrig/db.go')
-rw-r--r-- | testrig/db.go | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/testrig/db.go b/testrig/db.go index 771345fe1..17c8f83b0 100644 --- a/testrig/db.go +++ b/testrig/db.go @@ -44,6 +44,8 @@ var testModels = []interface{}{ >smodel.Marker{}, >smodel.MediaAttachment{}, >smodel.Mention{}, + >smodel.Poll{}, + >smodel.PollVote{}, >smodel.Status{}, >smodel.StatusToEmoji{}, >smodel.StatusToTag{}, @@ -315,6 +317,18 @@ func StandardDBSetup(db db.DB, accounts map[string]*gtsmodel.Account) { } } + for _, v := range NewTestPolls() { + if err := db.Put(ctx, v); err != nil { + log.Panic(nil, err) + } + } + + for _, v := range NewTestPollVotes() { + if err := db.Put(ctx, v); err != nil { + log.Panic(nil, err) + } + } + if err := db.CreateInstanceAccount(ctx); err != nil { log.Panic(nil, err) } @@ -330,7 +344,7 @@ func StandardDBSetup(db db.DB, accounts map[string]*gtsmodel.Account) { func StandardDBTeardown(db db.DB) { ctx := context.Background() if db == nil { - log.Panic(nil, "db was nil") + return } for _, m := range testModels { if err := db.DropTable(ctx, m); err != nil { |