first commit

This commit is contained in:
Beyhan Oğur
2026-04-26 22:25:19 +03:00
commit 361dbef019
25 changed files with 814 additions and 0 deletions

19
tests/test_auth.py Normal file
View File

@@ -0,0 +1,19 @@
from fastapi.testclient import TestClient
from app.main import app
client = TestClient(app)
def test_register_and_me():
email = "tester@example.com"
password = "password123"
r = client.post("/auth/register", json={"email": email, "password": password})
assert r.status_code == 200
tokens = r.json()
assert "access_token" in tokens
headers = {"Authorization": f"Bearer {tokens['access_token']}"}
r2 = client.get("/users/me", headers=headers)
assert r2.status_code == 200
data = r2.json()
assert data["email"] == email