mirror of
https://github.com/go-gitea/gitea
synced 2025-07-23 02:38:35 +00:00
Enable testifylint rules (#34075)
enable testifylint rules disabled in: https://github.com/go-gitea/gitea/pull/34054
This commit is contained in:
@@ -83,7 +83,7 @@ func TestSearchUsers(t *testing.T) {
|
||||
cassText := fmt.Sprintf("ids: %v, opts: %v", expectedUserOrOrgIDs, opts)
|
||||
if assert.Len(t, users, len(expectedUserOrOrgIDs), "case: %s", cassText) {
|
||||
for i, expectedID := range expectedUserOrOrgIDs {
|
||||
assert.EqualValues(t, expectedID, users[i].ID, "case: %s", cassText)
|
||||
assert.Equal(t, expectedID, users[i].ID, "case: %s", cassText)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -513,7 +513,7 @@ func Test_ValidateUser(t *testing.T) {
|
||||
{ID: 2, Visibility: structs.VisibleTypePrivate}: true,
|
||||
}
|
||||
for kase, expected := range kases {
|
||||
assert.EqualValues(t, expected, nil == user_model.ValidateUser(kase), "case: %+v", kase)
|
||||
assert.Equal(t, expected, nil == user_model.ValidateUser(kase), "case: %+v", kase)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -537,7 +537,7 @@ func Test_NormalizeUserFromEmail(t *testing.T) {
|
||||
for _, testCase := range testCases {
|
||||
normalizedName, err := user_model.NormalizeUserName(testCase.Input)
|
||||
assert.NoError(t, err)
|
||||
assert.EqualValues(t, testCase.Expected, normalizedName)
|
||||
assert.Equal(t, testCase.Expected, normalizedName)
|
||||
if testCase.IsNormalizedValid {
|
||||
assert.NoError(t, user_model.IsUsableUsername(normalizedName))
|
||||
} else {
|
||||
@@ -564,7 +564,7 @@ func TestEmailTo(t *testing.T) {
|
||||
for _, testCase := range testCases {
|
||||
t.Run(testCase.result, func(t *testing.T) {
|
||||
testUser := &user_model.User{FullName: testCase.fullName, Email: testCase.mail}
|
||||
assert.EqualValues(t, testCase.result, testUser.EmailTo())
|
||||
assert.Equal(t, testCase.result, testUser.EmailTo())
|
||||
})
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user