mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
fix: allow users to login using their email
Signed-off-by: Kevin Morris <kevr@0cost.org>
This commit is contained in:
parent
f3360d1249
commit
c80a16c254
2 changed files with 18 additions and 1 deletions
|
@ -79,6 +79,20 @@ def test_login_logout(client: TestClient, user: User):
|
|||
assert "AURSID" not in response.cookies
|
||||
|
||||
|
||||
def test_login_email(client: TestClient, user: user):
|
||||
post_data = {
|
||||
"user": user.Email,
|
||||
"passwd": "testPassword",
|
||||
"next": "/"
|
||||
}
|
||||
|
||||
with client as request:
|
||||
resp = request.post("/login", data=post_data,
|
||||
allow_redirects=False)
|
||||
assert resp.status_code == int(HTTPStatus.SEE_OTHER)
|
||||
assert "AURSID" in resp.cookies
|
||||
|
||||
|
||||
def mock_getboolean(a, b):
|
||||
if a == "options" and b == "disable_http_login":
|
||||
return True
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue