Testrig fixes (#50)

* testrig is runnable again
* little fixes, add some more test models
* address https://github.com/superseriousbusiness/gotosocial/issues/44
This commit is contained in:
Tobi Smethurst
2021-06-21 12:27:23 +02:00
committed by GitHub
parent aa8a0d0850
commit efbd839181
8 changed files with 379 additions and 209 deletions

View File

@ -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.