Cleanup usage of global logger (#26835)
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
92a6c6517d
Коммит
30d450c4d8
@@ -1122,7 +1122,7 @@ func TestPasswordRecovery(t *testing.T) {
|
||||
defer th.TearDown()
|
||||
|
||||
t.Run("password token with same email as during creation", func(t *testing.T) {
|
||||
token, err := th.App.CreatePasswordRecoveryToken(th.BasicUser.Id, th.BasicUser.Email)
|
||||
token, err := th.App.CreatePasswordRecoveryToken(th.Context, th.BasicUser.Id, th.BasicUser.Email)
|
||||
assert.Nil(t, err)
|
||||
|
||||
tokenData := struct {
|
||||
@@ -1140,7 +1140,7 @@ func TestPasswordRecovery(t *testing.T) {
|
||||
})
|
||||
|
||||
t.Run("password token with modified email as during creation", func(t *testing.T) {
|
||||
token, err := th.App.CreatePasswordRecoveryToken(th.BasicUser.Id, th.BasicUser.Email)
|
||||
token, err := th.App.CreatePasswordRecoveryToken(th.Context, th.BasicUser.Id, th.BasicUser.Email)
|
||||
assert.Nil(t, err)
|
||||
|
||||
th.App.UpdateConfig(func(c *model.Config) {
|
||||
@@ -1156,7 +1156,7 @@ func TestPasswordRecovery(t *testing.T) {
|
||||
})
|
||||
|
||||
t.Run("non-expired token", func(t *testing.T) {
|
||||
token, err := th.App.CreatePasswordRecoveryToken(th.BasicUser.Id, th.BasicUser.Email)
|
||||
token, err := th.App.CreatePasswordRecoveryToken(th.Context, th.BasicUser.Id, th.BasicUser.Email)
|
||||
assert.Nil(t, err)
|
||||
|
||||
err = th.App.resetPasswordFromToken(th.Context, token.Token, "abcdefgh", model.GetMillis())
|
||||
@@ -1164,7 +1164,7 @@ func TestPasswordRecovery(t *testing.T) {
|
||||
})
|
||||
|
||||
t.Run("expired token", func(t *testing.T) {
|
||||
token, err := th.App.CreatePasswordRecoveryToken(th.BasicUser.Id, th.BasicUser.Email)
|
||||
token, err := th.App.CreatePasswordRecoveryToken(th.Context, th.BasicUser.Id, th.BasicUser.Email)
|
||||
assert.Nil(t, err)
|
||||
|
||||
err = th.App.resetPasswordFromToken(th.Context, token.Token, "abcdefgh", model.GetMillisForTime(time.Now().Add(25*time.Hour)))
|
||||
@@ -1197,10 +1197,10 @@ func TestInvalidatePasswordRecoveryTokens(t *testing.T) {
|
||||
})
|
||||
|
||||
t.Run("add multiple tokens, should only be one valid", func(t *testing.T) {
|
||||
_, appErr := th.App.CreatePasswordRecoveryToken(th.BasicUser.Id, th.BasicUser.Email)
|
||||
_, appErr := th.App.CreatePasswordRecoveryToken(th.Context, th.BasicUser.Id, th.BasicUser.Email)
|
||||
assert.Nil(t, appErr)
|
||||
|
||||
token, appErr := th.App.CreatePasswordRecoveryToken(th.BasicUser.Id, th.BasicUser.Email)
|
||||
token, appErr := th.App.CreatePasswordRecoveryToken(th.Context, th.BasicUser.Id, th.BasicUser.Email)
|
||||
assert.Nil(t, appErr)
|
||||
|
||||
tokens, err := th.App.Srv().Store().Token().GetAllTokensByType(TokenTypePasswordRecovery)
|
||||
|
||||
Ссылка в новой задаче
Block a user