db: add tests for users (#6116)

* Add new methods

* Use Users.Create to replace previous hack

* Reduce side effect

* Do not clear tables when test failed

* test_users_Authenticate

* Rename constant

* test_users_Create

* test_users_GetByEmail

* test_users_GetByID

* test_users_GetByUsername
This commit is contained in:
ᴜɴᴋɴᴡᴏɴ
2020-04-18 12:07:30 +08:00
committed by GitHub
parent fa497b1633
commit 9d64d222a8
25 changed files with 506 additions and 112 deletions

View File

@@ -90,7 +90,7 @@ func EditUser(c *context.APIContext, form api.EditUserOption) {
c.Error(err, "get user salt")
return
}
u.EncodePasswd()
u.EncodePassword()
}
u.LoginName = form.LoginName