diff options
Diffstat (limited to 'testrig')
-rw-r--r-- | testrig/config.go | 3 | ||||
-rw-r--r-- | testrig/db.go | 6 | ||||
-rw-r--r-- | testrig/testmodels.go | 21 |
3 files changed, 30 insertions, 0 deletions
diff --git a/testrig/config.go b/testrig/config.go index 92d04c453..e0e5d1029 100644 --- a/testrig/config.go +++ b/testrig/config.go @@ -56,6 +56,9 @@ var TestDefaults = config.Configuration{ WebTemplateBaseDir: "./web/template/", WebAssetBaseDir: "./web/assets/", + InstanceExposePeers: true, + InstanceExposeSuspended: true, + AccountsRegistrationOpen: true, AccountsApprovalRequired: true, AccountsReasonRequired: true, diff --git a/testrig/db.go b/testrig/db.go index 67bc681c6..b4c05d727 100644 --- a/testrig/db.go +++ b/testrig/db.go @@ -153,6 +153,12 @@ func StandardDBSetup(db db.DB, accounts map[string]*gtsmodel.Account) { } } + for _, v := range NewTestInstances() { + if err := db.Put(ctx, v); err != nil { + logrus.Panic(err) + } + } + for _, v := range NewTestUsers() { if err := db.Put(ctx, v); err != nil { logrus.Panic(err) diff --git a/testrig/testmodels.go b/testrig/testmodels.go index e734ff255..bca894266 100644 --- a/testrig/testmodels.go +++ b/testrig/testmodels.go @@ -936,10 +936,31 @@ func NewTestEmojis() map[string]*gtsmodel.Emoji { } } +func NewTestInstances() map[string]*gtsmodel.Instance { + return map[string]*gtsmodel.Instance{ + "fossbros-anonymous.io": { + ID: "01G5H6YMJQKR86QZKXXQ2S95FZ", + CreatedAt: TimeMustParse("2021-09-20T12:40:37+02:00"), + UpdatedAt: TimeMustParse("2021-09-20T12:40:37+02:00"), + Domain: "fossbros-anonymous.io", + URI: "http://fossbros-anonymous.io", + }, + "example.org": { + ID: "01G5H71G52DJKVBYKXPNPNDN1G", + CreatedAt: TimeMustParse("2020-05-13T15:29:12+02:00"), + UpdatedAt: TimeMustParse("2020-05-13T15:29:12+02:00"), + Domain: "example.org", + URI: "http://example.org", + }, + } +} + func NewTestDomainBlocks() map[string]*gtsmodel.DomainBlock { return map[string]*gtsmodel.DomainBlock{ "replyguys.com": { ID: "01FF22EQM7X8E3RX1XGPN7S87D", + CreatedAt: TimeMustParse("2020-05-13T15:29:12+02:00"), + UpdatedAt: TimeMustParse("2020-05-13T15:29:12+02:00"), Domain: "replyguys.com", CreatedByAccountID: "01F8MH17FWEB39HZJ76B6VXSKF", PrivateComment: "i blocked this domain because they keep replying with pushy + unwarranted linux advice", |