Skip to content

Commit

Permalink
Proof test to prevent interference (#222)
Browse files Browse the repository at this point in the history
Fixes #205.

Co-authored-by: Daniel Milnes <thebeanogamer@gmail.com>
  • Loading branch information
jchristgit and thebeanogamer authored Jan 16, 2022
1 parent 3d19bd4 commit 35b9f20
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions src/authentication/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -697,8 +697,19 @@ def test_password_reset_issues_token(self):
"token": "testtoken",
"password": "uO7*$E@0ngqL",
}
response = self.client.post(reverse("do-password-reset"), data)
self.assertTrue("token" in response.data["d"])

try:
old_prelogin = config.get("enable_prelogin")
old_login = config.get("enable_login")

config.set("enable_prelogin", True)
config.set("enable_login", True)

response = self.client.post(reverse("do-password-reset"), data)
self.assertTrue("token" in response.data["d"])
finally:
config.set("enable_prelogin", old_prelogin)
config.set("enable_login", old_login)

def test_password_reset_bad_token(self):
data = {
Expand Down

0 comments on commit 35b9f20

Please sign in to comment.