mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
feat(FastAPI): add /pkgbase/{name}/request (get)
This change brings in the package base request form for new submissions. Signed-off-by: Kevin Morris <kevr@0cost.org>
This commit is contained in:
parent
1cf9420997
commit
ad8369395e
4 changed files with 157 additions and 0 deletions
|
@ -1400,3 +1400,23 @@ def test_requests_selfmade(client: TestClient, user: User,
|
|||
for row in rows:
|
||||
last_row = row.xpath('./td')[-1].xpath('./a')[0]
|
||||
assert last_row.text.strip() == "Close"
|
||||
|
||||
|
||||
def test_pkgbase_request_not_found(client: TestClient, user: User):
|
||||
pkgbase_name = "fake"
|
||||
endpoint = f"/pkgbase/{pkgbase_name}/request"
|
||||
|
||||
cookies = {"AURSID": user.login(Request(), "testPassword")}
|
||||
with client as request:
|
||||
resp = request.get(endpoint, cookies=cookies)
|
||||
assert resp.status_code == int(HTTPStatus.NOT_FOUND)
|
||||
|
||||
|
||||
def test_pkgbase_request(client: TestClient, user: User, package: Package):
|
||||
pkgbase = package.PackageBase
|
||||
endpoint = f"/pkgbase/{pkgbase.Name}/request"
|
||||
|
||||
cookies = {"AURSID": user.login(Request(), "testPassword")}
|
||||
with client as request:
|
||||
resp = request.get(endpoint, cookies=cookies)
|
||||
assert resp.status_code == int(HTTPStatus.OK)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue