mirror of
https://github.com/superseriousbusiness/gotosocial
synced 2025-06-05 21:59:39 +02:00
[feature] add support for polls + receiving federated status edits (#2330)
This commit is contained in:
@@ -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 {
|
||||
|
Reference in New Issue
Block a user