diff options
Diffstat (limited to 'models/user_test.go')
-rw-r--r-- | models/user_test.go | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/models/user_test.go b/models/user_test.go index c0b7dace7f..4fd0bc0fad 100644 --- a/models/user_test.go +++ b/models/user_test.go @@ -135,13 +135,11 @@ func TestHashPasswordDeterministic(t *testing.T) { pass := string(b) // save the current password in the user - hash it and store the result - u.Passwd = pass - u.HashPassword() + u.HashPassword(pass) r1 := u.Passwd // run again - u.Passwd = pass - u.HashPassword() + u.HashPassword(pass) r2 := u.Passwd // assert equal (given the same salt+pass, the same result is produced) @@ -158,7 +156,6 @@ func BenchmarkHashPassword(b *testing.B) { u := &User{Salt: string(bs), Passwd: pass} b.ResetTimer() for i := 0; i < b.N; i++ { - u.HashPassword() - u.Passwd = pass + u.HashPassword(pass) } } |