mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-05-23 04:39:28 +02:00
enable linter testifylint on v8 (#4573)
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/4573 Co-authored-by: TheFox0x7 <thefox0x7@gmail.com> Co-committed-by: TheFox0x7 <thefox0x7@gmail.com>
This commit is contained in:
parent
4d2263e82e
commit
ce563ade3d
503 changed files with 5014 additions and 4665 deletions
|
@ -17,7 +17,7 @@ import (
|
|||
)
|
||||
|
||||
func TestIssueList_LoadRepositories(t *testing.T) {
|
||||
assert.NoError(t, unittest.PrepareTestDatabase())
|
||||
require.NoError(t, unittest.PrepareTestDatabase())
|
||||
|
||||
issueList := issues_model.IssueList{
|
||||
unittest.AssertExistsAndLoadBean(t, &issues_model.Issue{ID: 1}),
|
||||
|
@ -26,7 +26,7 @@ func TestIssueList_LoadRepositories(t *testing.T) {
|
|||
}
|
||||
|
||||
repos, err := issueList.LoadRepositories(db.DefaultContext)
|
||||
assert.NoError(t, err)
|
||||
require.NoError(t, err)
|
||||
assert.Len(t, repos, 2)
|
||||
for _, issue := range issueList {
|
||||
assert.EqualValues(t, issue.RepoID, issue.Repo.ID)
|
||||
|
@ -34,14 +34,14 @@ func TestIssueList_LoadRepositories(t *testing.T) {
|
|||
}
|
||||
|
||||
func TestIssueList_LoadAttributes(t *testing.T) {
|
||||
assert.NoError(t, unittest.PrepareTestDatabase())
|
||||
require.NoError(t, unittest.PrepareTestDatabase())
|
||||
setting.Service.EnableTimetracking = true
|
||||
issueList := issues_model.IssueList{
|
||||
unittest.AssertExistsAndLoadBean(t, &issues_model.Issue{ID: 1}),
|
||||
unittest.AssertExistsAndLoadBean(t, &issues_model.Issue{ID: 4}),
|
||||
}
|
||||
|
||||
assert.NoError(t, issueList.LoadAttributes(db.DefaultContext))
|
||||
require.NoError(t, issueList.LoadAttributes(db.DefaultContext))
|
||||
for _, issue := range issueList {
|
||||
assert.EqualValues(t, issue.RepoID, issue.Repo.ID)
|
||||
for _, label := range issue.Labels {
|
||||
|
@ -75,14 +75,14 @@ func TestIssueList_LoadAttributes(t *testing.T) {
|
|||
}
|
||||
}
|
||||
|
||||
assert.NoError(t, issueList.LoadIsRead(db.DefaultContext, 1))
|
||||
require.NoError(t, issueList.LoadIsRead(db.DefaultContext, 1))
|
||||
for _, issue := range issueList {
|
||||
assert.Equal(t, issue.ID == 1, issue.IsRead, "unexpected is_read value for issue[%d]", issue.ID)
|
||||
}
|
||||
}
|
||||
|
||||
func TestIssueListLoadUser(t *testing.T) {
|
||||
assert.NoError(t, unittest.PrepareTestDatabase())
|
||||
require.NoError(t, unittest.PrepareTestDatabase())
|
||||
|
||||
issue := unittest.AssertExistsAndLoadBean(t, &issues_model.Issue{})
|
||||
doer := unittest.AssertExistsAndLoadBean(t, &user_model.User{ID: 1})
|
||||
|
@ -121,7 +121,7 @@ func TestIssueListLoadUser(t *testing.T) {
|
|||
|
||||
issue.PosterID = testCase.poster
|
||||
issue.Poster = nil
|
||||
assert.NoError(t, list.LoadPosters(db.DefaultContext))
|
||||
require.NoError(t, list.LoadPosters(db.DefaultContext))
|
||||
require.NotNil(t, issue.Poster)
|
||||
assert.Equal(t, testCase.user.ID, issue.Poster.ID)
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue