X-Git-Url: https://git.squeep.com/?a=blobdiff_plain;f=test%2Fpleroma%2Fweb%2Ftwitter_api%2Fpassword_controller_test.exs;h=cf99e243418252239ae99b3414d23e2f59a8279f;hb=03f38ac4ebd97e792b0ff2a6ac804adefed85a41;hp=6d08075cc5187e4b36eae23ab1d4f3237f11a2ac;hpb=ecd1ef8cb5afa16dba5158e9e278a18c0856ca3e;p=akkoma
diff --git a/test/pleroma/web/twitter_api/password_controller_test.exs b/test/pleroma/web/twitter_api/password_controller_test.exs
index 6d08075cc..cf99e2434 100644
--- a/test/pleroma/web/twitter_api/password_controller_test.exs
+++ b/test/pleroma/web/twitter_api/password_controller_test.exs
@@ -1,5 +1,5 @@
# Pleroma: A lightweight social networking server
-# Copyright © 2017-2020 Pleroma Authors
+# Copyright © 2017-2021 Pleroma Authors
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Web.TwitterAPI.PasswordControllerTest do
@@ -37,8 +37,7 @@ defmodule Pleroma.Web.TwitterAPI.PasswordControllerTest do
user = insert(:user)
{:ok, token} = PasswordResetToken.create_token(user)
-
- :timer.sleep(2000)
+ {:ok, token} = time_travel(token, -2)
response =
conn
@@ -55,7 +54,7 @@ defmodule Pleroma.Web.TwitterAPI.PasswordControllerTest do
user = insert(:user)
{:ok, token} = PasswordResetToken.create_token(user)
- :timer.sleep(2000)
+ {:ok, token} = time_travel(token, -2)
{:ok, _access_token} = Token.create(insert(:oauth_app), user, %{})
params = %{
@@ -93,7 +92,7 @@ defmodule Pleroma.Web.TwitterAPI.PasswordControllerTest do
assert response =~ "
Password changed!
"
user = refresh_record(user)
- assert Pbkdf2.verify_pass("test", user.password_hash)
+ assert Pleroma.Password.Pbkdf2.verify_pass("test", user.password_hash)
assert Enum.empty?(Token.get_user_tokens(user))
end