diff options
| author | 2024-03-10 11:59:55 +0100 | |
|---|---|---|
| committer | 2024-03-11 10:52:12 +0100 | |
| commit | 0bd95d7b71ae71d801b0fbb643598eb0ccd1b8f5 (patch) | |
| tree | 87fbf0b9d8fc158ff4857ad8f407dc47389f2327 /internal/db/bundb/account_test.go | |
| parent | [chore] seperate snapshot from release in goreleaser (#2740) (diff) | |
| download | gotosocial-0.14.2.tar.xz | |
[bugfix] Don't error when populating MovedTo if account not found (#2741)v0.14.2
* [bugfix] Don't error when populating MovedTo if account not found
* test the thing
Diffstat (limited to 'internal/db/bundb/account_test.go')
| -rw-r--r-- | internal/db/bundb/account_test.go | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/internal/db/bundb/account_test.go b/internal/db/bundb/account_test.go index f01964da8..268c25c59 100644 --- a/internal/db/bundb/account_test.go +++ b/internal/db/bundb/account_test.go @@ -482,6 +482,17 @@ func (suite *AccountTestSuite) TestCountAccountPinnedNothingPinned() { suite.Equal(pinned, 0) // This account has nothing pinned. } +func (suite *AccountTestSuite) TestPopulateAccountWithUnknownMovedToURI() { + testAccount := >smodel.Account{} + *testAccount = *suite.testAccounts["local_account_1"] + + // Set test account MovedToURI to something we don't have in the database. + // We should not get an error when populating. + testAccount.MovedToURI = "https://unknown-instance.example.org/users/someone_we_dont_know" + err := suite.db.PopulateAccount(context.Background(), testAccount) + suite.NoError(err) +} + func TestAccountTestSuite(t *testing.T) { suite.Run(t, new(AccountTestSuite)) } |
