test: Fix reset password test
This commit is contained in:
parent
093c72e963
commit
fe15028df3
2 changed files with 18 additions and 6 deletions
|
|
@ -70,5 +70,19 @@
|
|||
"role": "System Manager"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"doctype": "User",
|
||||
"email": "testpassword@example.com",
|
||||
"enabled": 1,
|
||||
"first_name": "_Test",
|
||||
"new_password": "Eastern_43A1W",
|
||||
"roles": [
|
||||
{
|
||||
"doctype": "Has Role",
|
||||
"parentfield": "roles",
|
||||
"role": "System Manager"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
|
|
|
|||
|
|
@ -314,12 +314,10 @@ class TestUser(unittest.TestCase):
|
|||
frappe.local.cookie_manager = CookieManager()
|
||||
frappe.local.login_manager = LoginManager()
|
||||
|
||||
frappe.set_user("test@example.com")
|
||||
test_user = frappe.get_doc("User", "test@example.com")
|
||||
frappe.set_user("testpassword@example.com")
|
||||
test_user = frappe.get_doc("User", "testpassword@example.com")
|
||||
test_user.reset_password()
|
||||
pwd_key = test_user.reset_password_key
|
||||
test_user.reload()
|
||||
self.assertEqual(update_password(new_password, key=pwd_key), "/app")
|
||||
self.assertEqual(update_password(new_password, key=test_user.reset_password_key), "/app")
|
||||
self.assertEqual(update_password(new_password, key="wrong_key"), "The Link specified has either been used before or Invalid")
|
||||
|
||||
# password verification should fail with old password
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue