aboutsummaryrefslogtreecommitdiff
path: root/tests/http/test_auth.py
diff options
context:
space:
mode:
authorstuppie2026-11-04 12:11:03 -0600
committerstuppie2026-11-04 12:11:03 -0600
commit671a7b1b02503cfa5c9aecd40c27a0c2729a285b (patch)
tree6cb1bd7c33e3e1d243ee5ae74decc57faaa5742d /tests/http/test_auth.py
parente99ec6b7e38113a2237dc1ff402d8f4337c651d5 (diff)
downloadamt-jb-671a7b1b02503cfa5c9aecd40c27a0c2729a285b.tar.gz
amt-jb-671a7b1b02503cfa5c9aecd40c27a0c2729a285b.zip
strip out AMT
Diffstat (limited to 'tests/http/test_auth.py')
-rw-r--r--tests/http/test_auth.py14
1 files changed, 6 insertions, 8 deletions
diff --git a/tests/http/test_auth.py b/tests/http/test_auth.py
index b44a36a..40f0366 100644
--- a/tests/http/test_auth.py
+++ b/tests/http/test_auth.py
@@ -1,4 +1,5 @@
from urllib.parse import parse_qs, urlparse
+from uuid import uuid4
import pytest
from httpx import AsyncClient
@@ -35,9 +36,6 @@ class FakeGRApiManager:
return user
-@pytest.fixture
-def email() -> str:
- return "unittest@generalresearch.com"
@pytest.fixture
@@ -58,20 +56,20 @@ class TestAuth:
):
client = httpxclient
- res = await client.post("/auth/magic-link/request", json={"email": email})
+ res = await client.post("/auth/magic-link/request/", json={"email": email})
d = res.json()
assert res.status_code == 200
assert d["magic_link"]
token = parse_qs(urlparse(d["magic_link"]).query)["token"][0]
- url = "/auth/magic-link/exchange"
+ url = "/auth/magic-link/exchange/"
body = {"token": token}
res = await client.post(url, json=body)
assert res.status_code == 204
assert client.cookies.get(SESSION_COOKIE_NAME)
- res = await client.get("/auth/session")
+ res = await client.get("/auth/session/")
assert res.status_code == 200
assert res.json()["email"] == email
@@ -87,7 +85,7 @@ class TestAuth:
fake_gr_api_manager.add_amt_user(amt_worker_id)
res = await client.post(
- "/auth/link-amt/request",
+ "/auth/link-amt/request/",
json={"email": email, "amt_worker_id": amt_worker_id},
)
d = res.json()
@@ -110,7 +108,7 @@ class TestAuth:
assert transitioned_amt_worker_id == amt_worker_id
assert amt_worker_id not in fake_gr_api_manager.amt_worker_ids
- res = await client.get("/auth/session")
+ res = await client.get("/auth/session/")
assert res.status_code == 200
assert res.json()["email"] == email