summaryrefslogtreecommitdiff
path: root/testrig/db.go
diff options
context:
space:
mode:
authorLibravatar Tobi Smethurst <31960611+tsmethurst@users.noreply.github.com>2021-06-21 12:27:23 +0200
committerLibravatar GitHub <noreply@github.com>2021-06-21 12:27:23 +0200
commitefbd83918137930001f7eda62ab5805a54da7a1d (patch)
treeacccb8f0650c32044e1f7769ce4b5ebb51b80f62 /testrig/db.go
parentStreaming (#49) (diff)
downloadgotosocial-efbd83918137930001f7eda62ab5805a54da7a1d.tar.xz
Testrig fixes (#50)
* testrig is runnable again * little fixes, add some more test models * address https://github.com/superseriousbusiness/gotosocial/issues/44
Diffstat (limited to 'testrig/db.go')
-rw-r--r--testrig/db.go18
1 files changed, 18 insertions, 0 deletions
diff --git a/testrig/db.go b/testrig/db.go
index fb4a4e6e7..5fa019adc 100644
--- a/testrig/db.go
+++ b/testrig/db.go
@@ -45,6 +45,8 @@ var testModels []interface{} = []interface{}{
&gtsmodel.Tag{},
&gtsmodel.User{},
&gtsmodel.Emoji{},
+ &gtsmodel.Instance{},
+ &gtsmodel.Notification{},
&oauth.Token{},
&oauth.Client{},
}
@@ -129,9 +131,25 @@ func StandardDBSetup(db db.DB) {
}
}
+ for _, v := range NewTestFollows() {
+ if err := db.Put(v); err != nil {
+ panic(err)
+ }
+ }
+
+ for _, v := range NewTestNotifications() {
+ if err := db.Put(v); err != nil {
+ panic(err)
+ }
+ }
+
if err := db.CreateInstanceAccount(); err != nil {
panic(err)
}
+
+ if err := db.CreateInstanceInstance(); err != nil {
+ panic(err)
+ }
}
// StandardDBTeardown drops all the standard testing tables/models from the database to ensure it's clean for the next test.