summaryrefslogtreecommitdiff
path: root/internal/db/bundb/application_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/db/bundb/application_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/db/bundb/application_test.go')
-rw-r--r--internal/db/bundb/application_test.go10
1 files changed, 5 insertions, 5 deletions
diff --git a/internal/db/bundb/application_test.go b/internal/db/bundb/application_test.go
index 858cb15b6..a9ef80ce4 100644
--- a/internal/db/bundb/application_test.go
+++ b/internal/db/bundb/application_test.go
@@ -36,7 +36,7 @@ func (suite *ApplicationTestSuite) TestGetApplicationBy() {
t := suite.T()
// Create a new context for this test.
- ctx, cncl := context.WithCancel(context.Background())
+ ctx, cncl := context.WithCancel(suite.T().Context())
defer cncl()
// Sentinel error to mark avoiding a test case.
@@ -86,7 +86,7 @@ func (suite *ApplicationTestSuite) TestDeleteApplicationBy() {
t := suite.T()
// Create a new context for this test.
- ctx, cncl := context.WithCancel(context.Background())
+ ctx, cncl := context.WithCancel(suite.T().Context())
defer cncl()
for _, app := range suite.testApplications {
@@ -117,7 +117,7 @@ func (suite *ApplicationTestSuite) TestDeleteApplicationBy() {
}
func (suite *ApplicationTestSuite) TestGetAllTokens() {
- tokens, err := suite.db.GetAllTokens(context.Background())
+ tokens, err := suite.db.GetAllTokens(suite.T().Context())
if err != nil {
suite.FailNow(err.Error())
}
@@ -125,7 +125,7 @@ func (suite *ApplicationTestSuite) TestGetAllTokens() {
}
func (suite *ApplicationTestSuite) TestDeleteTokensByClientID() {
- ctx := context.Background()
+ ctx := suite.T().Context()
// Delete tokens by each app.
for _, app := range suite.testApplications {
@@ -147,7 +147,7 @@ func (suite *ApplicationTestSuite) TestDeleteTokensByUnknownClientID() {
// Should not return ErrNoRows even though
// the client with given ID doesn't exist.
if err := suite.state.DB.DeleteTokensByClientID(
- context.Background(),
+ suite.T().Context(),
"01JPJ4NCGH6GHY7ZVYBHNP55XS",
); err != nil {
suite.FailNow(err.Error())