mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-10-29 02:22:26 -05:00
Dereference remote replies (#132)
* decided where to put reply dereferencing * fiddling with dereferencing threads * further adventures * tidy up some stuff * move dereferencing functionality * a bunch of refactoring * go fmt * more refactoring * bleep bloop * docs and linting * start implementing replies collection on gts side * fiddling around * allow dereferencing our replies * lint, fmt
This commit is contained in:
parent
0386a28b5a
commit
0f2de6394a
68 changed files with 2946 additions and 1393 deletions
|
|
@ -65,7 +65,14 @@ func NewTestDB() db.DB {
|
|||
}
|
||||
|
||||
// StandardDBSetup populates a given db with all the necessary tables/models for perfoming tests.
|
||||
func StandardDBSetup(db db.DB) {
|
||||
//
|
||||
// The accounts parameter is provided in case the db should be populated with a certain set of accounts.
|
||||
// If accounts is nil, then the standard test accounts will be used.
|
||||
//
|
||||
// When testing http signatures, you should pass into this function the same accounts map that you generated
|
||||
// signatures with, otherwise this function will randomly generate new keys for accounts and signature
|
||||
// verification will fail.
|
||||
func StandardDBSetup(db db.DB, accounts map[string]*gtsmodel.Account) {
|
||||
for _, m := range testModels {
|
||||
if err := db.CreateTable(m); err != nil {
|
||||
panic(err)
|
||||
|
|
@ -96,9 +103,17 @@ func StandardDBSetup(db db.DB) {
|
|||
}
|
||||
}
|
||||
|
||||
for _, v := range NewTestAccounts() {
|
||||
if err := db.Put(v); err != nil {
|
||||
panic(err)
|
||||
if accounts == nil {
|
||||
for _, v := range NewTestAccounts() {
|
||||
if err := db.Put(v); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
}
|
||||
} else {
|
||||
for _, v := range accounts {
|
||||
if err := db.Put(v); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue