summaryrefslogtreecommitdiff
path: root/internal/api/client/search/searchget_test.go
diff options
context:
space:
mode:
authorLibravatar Daenney <git@noreply.sourcery.dny.nu>2025-05-22 12:26:11 +0200
committerLibravatar kim <gruf@noreply.codeberg.org>2025-05-22 12:26:11 +0200
commitd5c9c4adc167cdb05e73f5105702cf340293e61c (patch)
tree1d21fe376099864900837eba675a965517f98e5d /internal/api/client/search/searchget_test.go
parent[feature] Allow exposing allows, implement `/api/v1/domain_blocks` and `/api/... (diff)
downloadgotosocial-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/client/search/searchget_test.go')
-rw-r--r--internal/api/client/search/searchget_test.go11
1 files changed, 5 insertions, 6 deletions
diff --git a/internal/api/client/search/searchget_test.go b/internal/api/client/search/searchget_test.go
index b978c0d3f..651d5301d 100644
--- a/internal/api/client/search/searchget_test.go
+++ b/internal/api/client/search/searchget_test.go
@@ -18,7 +18,6 @@
package search_test
import (
- "context"
"crypto/rand"
"crypto/rsa"
"encoding/json"
@@ -160,7 +159,7 @@ func (suite *SearchGetTestSuite) bodgeLocalInstance(domain string) {
// Set username of instance account to given domain.
instanceAccount.Username = domain
- if err := suite.db.UpdateAccount(context.Background(), instanceAccount, "username"); err != nil {
+ if err := suite.db.UpdateAccount(suite.T().Context(), instanceAccount, "username"); err != nil {
suite.FailNow(err.Error())
}
}
@@ -1389,7 +1388,7 @@ func (suite *SearchGetTestSuite) TestSearchRemoteInstanceAccountPartial() {
suite.FailNow(err.Error())
}
- if err := suite.db.PutAccount(context.Background(), &gtsmodel.Account{
+ if err := suite.db.PutAccount(suite.T().Context(), &gtsmodel.Account{
ID: "01H6RWPG8T6DNW6VNXPBCJBH5S",
Username: theirDomain,
Domain: theirDomain,
@@ -1724,7 +1723,7 @@ func (suite *SearchGetTestSuite) TestSearchBlockedAccountFullNamestring() {
// Block the account
// we're about to search.
if err := suite.db.PutBlock(
- context.Background(),
+ suite.T().Context(),
&gtsmodel.Block{
ID: id.NewULID(),
URI: "https://example.org/nooooooo",
@@ -1788,7 +1787,7 @@ func (suite *SearchGetTestSuite) TestSearchBlockedAccountPartialNamestring() {
// Block the account
// we're about to search.
if err := suite.db.PutBlock(
- context.Background(),
+ suite.T().Context(),
&gtsmodel.Block{
ID: id.NewULID(),
URI: "https://example.org/nooooooo",
@@ -1849,7 +1848,7 @@ func (suite *SearchGetTestSuite) TestSearchBlockedAccountURI() {
// Block the account
// we're about to search.
if err := suite.db.PutBlock(
- context.Background(),
+ suite.T().Context(),
&gtsmodel.Block{
ID: id.NewULID(),
URI: "https://example.org/nooooooo",