enable linter testifylint on v7 (#4572)

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/4572
Co-authored-by: TheFox0x7 <thefox0x7@gmail.com>
Co-committed-by: TheFox0x7 <thefox0x7@gmail.com>
This commit is contained in:
TheFox0x7 2024-07-30 19:42:06 +00:00 committed by Earl Warren
parent c47bdf436b
commit 072dd9f8bc
494 changed files with 4897 additions and 4554 deletions

View file

@ -28,6 +28,7 @@ import (
"code.gitea.io/gitea/tests"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
func TestPullrequestReopen(t *testing.T) {
@ -66,14 +67,14 @@ func TestPullrequestReopen(t *testing.T) {
Committer: time.Now(),
},
})
assert.NoError(t, err)
require.NoError(t, err)
// Create an head repository.
headRepo, err := repo_service.ForkRepository(git.DefaultContext, user2, org26, repo_service.ForkRepoOptions{
BaseRepo: baseRepo,
Name: "reopen-head",
})
assert.NoError(t, err)
require.NoError(t, err)
assert.NotEmpty(t, headRepo)
// Add a change to the head repository, so a pull request can be opened.
@ -101,7 +102,7 @@ func TestPullrequestReopen(t *testing.T) {
Committer: time.Now(),
},
})
assert.NoError(t, err)
require.NoError(t, err)
// Create the pull reuqest.
pullIssue := &issues_model.Issue{
@ -121,13 +122,13 @@ func TestPullrequestReopen(t *testing.T) {
Type: issues_model.PullRequestGitea,
}
err = pull_service.NewPullRequest(git.DefaultContext, baseRepo, pullIssue, nil, nil, pullRequest, nil)
assert.NoError(t, err)
require.NoError(t, err)
issue := unittest.AssertExistsAndLoadBean(t, &issues_model.Issue{Title: "Testing reopen functionality"})
// Close the PR.
err = issue_service.ChangeStatus(db.DefaultContext, issue, user2, "", true)
assert.NoError(t, err)
require.NoError(t, err)
session := loginUser(t, "user2")