summaryrefslogtreecommitdiff
path: root/internal/db/bundb/domain_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/domain_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/domain_test.go')
-rw-r--r--internal/db/bundb/domain_test.go13
1 files changed, 6 insertions, 7 deletions
diff --git a/internal/db/bundb/domain_test.go b/internal/db/bundb/domain_test.go
index 553cdeb80..8ebe0a2ba 100644
--- a/internal/db/bundb/domain_test.go
+++ b/internal/db/bundb/domain_test.go
@@ -18,7 +18,6 @@
package bundb_test
import (
- "context"
"slices"
"testing"
"time"
@@ -32,7 +31,7 @@ type DomainTestSuite struct {
}
func (suite *DomainTestSuite) TestIsDomainBlocked() {
- ctx := context.Background()
+ ctx := suite.T().Context()
domainBlock := &gtsmodel.DomainBlock{
ID: "01G204214Y9TNJEBX39C7G88SW",
@@ -57,7 +56,7 @@ func (suite *DomainTestSuite) TestIsDomainBlocked() {
}
func (suite *DomainTestSuite) TestIsDomainBlockedWithAllow() {
- ctx := context.Background()
+ ctx := suite.T().Context()
domainBlock := &gtsmodel.DomainBlock{
ID: "01G204214Y9TNJEBX39C7G88SW",
@@ -110,7 +109,7 @@ func (suite *DomainTestSuite) TestIsDomainBlockedWithAllow() {
}
func (suite *DomainTestSuite) TestIsDomainBlockedWildcard() {
- ctx := context.Background()
+ ctx := suite.T().Context()
domainBlock := &gtsmodel.DomainBlock{
ID: "01G204214Y9TNJEBX39C7G88SW",
@@ -142,7 +141,7 @@ func (suite *DomainTestSuite) TestIsDomainBlockedWildcard() {
}
func (suite *DomainTestSuite) TestIsDomainBlockedNonASCII() {
- ctx := context.Background()
+ ctx := suite.T().Context()
now := time.Now()
@@ -178,7 +177,7 @@ func (suite *DomainTestSuite) TestIsDomainBlockedNonASCII() {
}
func (suite *DomainTestSuite) TestIsDomainBlockedNonASCII2() {
- ctx := context.Background()
+ ctx := suite.T().Context()
now := time.Now()
@@ -214,7 +213,7 @@ func (suite *DomainTestSuite) TestIsDomainBlockedNonASCII2() {
}
func (suite *DomainTestSuite) TestIsOtherDomainBlockedWildcardAndExplicit() {
- ctx := context.Background()
+ ctx := suite.T().Context()
blocks := []*gtsmodel.DomainBlock{
{