mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
add account (view) route
+ Added get /account/{username} route. + Added account/show.html template which shows a single use Signed-off-by: Kevin Morris <kevr@0cost.org>
This commit is contained in:
parent
4e9ef6fb00
commit
4f928b4577
3 changed files with 142 additions and 3 deletions
|
@ -869,4 +869,33 @@ def test_post_account_edit_password():
|
|||
assert user.valid_password("newPassword")
|
||||
|
||||
|
||||
>>>>>> > dddd1137... add account edit(settings) routes
|
||||
def test_get_account():
|
||||
request = Request()
|
||||
sid = user.login(request, "testPassword")
|
||||
|
||||
with client as request:
|
||||
response = request.get("/account/test", cookies={"AURSID": sid},
|
||||
allow_redirects=False)
|
||||
|
||||
assert response.status_code == int(HTTPStatus.OK)
|
||||
|
||||
|
||||
def test_get_account_not_found():
|
||||
request = Request()
|
||||
sid = user.login(request, "testPassword")
|
||||
|
||||
with client as request:
|
||||
response = request.get("/account/not_found", cookies={"AURSID": sid},
|
||||
allow_redirects=False)
|
||||
|
||||
assert response.status_code == int(HTTPStatus.NOT_FOUND)
|
||||
|
||||
|
||||
def test_get_account_unauthenticated():
|
||||
with client as request:
|
||||
response = request.get("/account/test", allow_redirects=False)
|
||||
|
||||
assert response.status_code == int(HTTPStatus.UNAUTHORIZED)
|
||||
|
||||
content = response.content.decode()
|
||||
assert "You must log in to view user information." in content
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue