diff options
author | wxiaoguang <wxiaoguang@gmail.com> | 2024-10-10 17:04:42 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-10-10 09:04:42 +0000 |
commit | 6029d78ab5006e8fb4f42adb5a8c491f19fa7b0a (patch) | |
tree | a0777b84d093799346d7c1710b45cdf00e0e8cb5 /services | |
parent | c2217670dd7514e17fc9c1f17d7e459b842ea798 (diff) | |
download | gitea-6029d78ab5006e8fb4f42adb5a8c491f19fa7b0a.tar.gz gitea-6029d78ab5006e8fb4f42adb5a8c491f19fa7b0a.zip |
Improve the maintainblity of the reserved username list (#32229)
Diffstat (limited to 'services')
-rw-r--r-- | services/user/user_test.go | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/services/user/user_test.go b/services/user/user_test.go index cd0f597501..efcbc669c8 100644 --- a/services/user/user_test.go +++ b/services/user/user_test.go @@ -114,12 +114,10 @@ func TestRenameUser(t *testing.T) { }) t.Run("Non usable username", func(t *testing.T) { - usernames := []string{"--diff", "aa.png", ".well-known", "search", "aaa.atom"} + usernames := []string{"--diff", ".well-known", "gitea-actions", "aaa.atom", "aa.png"} for _, username := range usernames { - t.Run(username, func(t *testing.T) { - assert.Error(t, user_model.IsUsableUsername(username)) - assert.Error(t, RenameUser(db.DefaultContext, user, username)) - }) + assert.Error(t, user_model.IsUsableUsername(username), "non-usable username: %s", username) + assert.Error(t, RenameUser(db.DefaultContext, user, username), "non-usable username: %s", username) } }) |