diff options
| author | 2025-05-22 12:26:11 +0200 | |
|---|---|---|
| committer | 2025-05-22 12:26:11 +0200 | |
| commit | d5c9c4adc167cdb05e73f5105702cf340293e61c (patch) | |
| tree | 1d21fe376099864900837eba675a965517f98e5d /internal/api/activitypub/users/userget_test.go | |
| parent | [feature] Allow exposing allows, implement `/api/v1/domain_blocks` and `/api/... (diff) | |
| download | gotosocial-d5c9c4adc167cdb05e73f5105702cf340293e61c.tar.xz | |
[chore] Upgrade to Go 1.24 (#4187)
* Set `go.mod` to 1.24 now that it's been out for 3 months.
* Update all the test to use `testing.T.Context()`.
Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4187
Co-authored-by: Daenney <git@noreply.sourcery.dny.nu>
Co-committed-by: Daenney <git@noreply.sourcery.dny.nu>
Diffstat (limited to 'internal/api/activitypub/users/userget_test.go')
| -rw-r--r-- | internal/api/activitypub/users/userget_test.go | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/internal/api/activitypub/users/userget_test.go b/internal/api/activitypub/users/userget_test.go index 06bc46452..a9cba468f 100644 --- a/internal/api/activitypub/users/userget_test.go +++ b/internal/api/activitypub/users/userget_test.go @@ -18,7 +18,6 @@ package users_test import ( - "context" "encoding/json" "io/ioutil" "net/http" @@ -79,14 +78,14 @@ func (suite *UserGetTestSuite) TestGetUser() { err = json.Unmarshal(b, &m) suite.NoError(err) - t, err := streams.ToType(context.Background(), m) + t, err := streams.ToType(suite.T().Context(), m) suite.NoError(err) person, ok := t.(vocab.ActivityStreamsPerson) suite.True(ok) // convert person to account - a, err := suite.tc.ASRepresentationToAccount(context.Background(), person, "", "") + a, err := suite.tc.ASRepresentationToAccount(suite.T().Context(), person, "", "") suite.NoError(err) suite.EqualValues(targetAccount.Username, a.Username) } @@ -97,11 +96,11 @@ func (suite *UserGetTestSuite) TestGetUserPublicKeyDeleted() { userModule := users.New(suite.processor) targetAccount := suite.testAccounts["local_account_1"] - suite.processor.User().DeleteSelf(context.Background(), suite.testAccounts["local_account_1"]) + suite.processor.User().DeleteSelf(suite.T().Context(), suite.testAccounts["local_account_1"]) // wait for the account delete to be processed if !testrig.WaitFor(func() bool { - a, _ := suite.db.GetAccountByID(context.Background(), targetAccount.ID) + a, _ := suite.db.GetAccountByID(suite.T().Context(), targetAccount.ID) return !a.SuspendedAt.IsZero() }) { suite.FailNow("delete of account timed out") @@ -147,14 +146,14 @@ func (suite *UserGetTestSuite) TestGetUserPublicKeyDeleted() { err = json.Unmarshal(b, &m) suite.NoError(err) - t, err := streams.ToType(context.Background(), m) + t, err := streams.ToType(suite.T().Context(), m) suite.NoError(err) person, ok := t.(vocab.ActivityStreamsPerson) suite.True(ok) // convert person to account - a, err := suite.tc.ASRepresentationToAccount(context.Background(), person, "", "") + a, err := suite.tc.ASRepresentationToAccount(suite.T().Context(), person, "", "") suite.NoError(err) suite.EqualValues(targetAccount.Username, a.Username) } |
