1
0
Fork 0
mirror of https://codeberg.org/forgejo/forgejo.git synced 2024-11-21 08:31:27 -05:00

test(cli): admin user change-password --must-change-password

This commit is contained in:
Earl Warren 2024-04-24 12:24:19 +02:00
parent eb74846d7d
commit b9424e634f
No known key found for this signature in database
GPG key ID: 0579CB2928A78A00

View file

@ -53,6 +53,14 @@ func Test_Cmd_AdminUser(t *testing.T) {
user := unittest.AssertExistsAndLoadBean(t, &user_model.User{Name: name})
assert.Equal(t, testCase.mustChangePassword, user.MustChangePassword)
options = []string{"user", "change-password", "--username", name, "--password", "password"}
options = append(options, testCase.options...)
output, err = runMainApp("admin", options...)
assert.NoError(t, err)
assert.Contains(t, output, "has been successfully updated")
user = unittest.AssertExistsAndLoadBean(t, &user_model.User{Name: name})
assert.Equal(t, testCase.mustChangePassword, user.MustChangePassword)
_, err = runMainApp("admin", "user", "delete", "--username", name)
assert.NoError(t, err)
unittest.AssertNotExistsBean(t, &user_model.User{Name: name})