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:
Kevin Morris 2021-09-12 21:51:20 -07:00
parent 1cf9420997
commit ad8369395e
No known key found for this signature in database
GPG key ID: F7E46DED420788F3
4 changed files with 157 additions and 0 deletions

View file

@ -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)