Add some tests to clarify the "must-change-password" behavior (#30693)

Follow  #30472:

When a user is created by command line `./gitea admin user create`:

Old behavior before #30472: the first user (admin or non-admin) doesn't
need to change password.

Revert to the old behavior before #30472
This commit is contained in:
wxiaoguang 2024-04-27 20:23:37 +08:00 committed by GitHub
parent dd301cae1c
commit d3cdef88ad
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 81 additions and 17 deletions

View file

@ -28,7 +28,7 @@ func makePathOutput(workPath, customPath, customConf string) string {
}
func newTestApp(testCmdAction func(ctx *cli.Context) error) *cli.App {
app := NewMainApp("version", "version-extra")
app := NewMainApp(AppVersion{})
testCmd := &cli.Command{Name: "test-cmd", Action: testCmdAction}
prepareSubcommandWithConfig(testCmd, appGlobalFlags())
app.Commands = append(app.Commands, testCmd)