Files
devplacepy/tests/api/auth/signup.py
T
retoor 43f4011005 chore: reorganize test files into domain-specific subdirectories under tests/
Split the monolithic test directory into three tiers (unit, api, e2e) with a path-mirroring directory structure. Added corresponding Makefile targets (test-unit, test-api, test-e2e) and updated all documentation references (CLAUDE.md, README.md, testing-cicd.html, testing-framework.html, testing-make.html) to reflect the new layout and naming conventions.
2026-06-13 14:32:33 +00:00

35 lines
898 B
Python

# retoor <retoor@molodetz.nl>
import time
import requests
from tests.conftest import BASE_URL
def _session_validation():
s = requests.Session()
name = f"val_{int(time.time() * 1000)}"
s.post(
f"{BASE_URL}/auth/signup",
data={
"username": name,
"email": f"{name}@t.dev",
"password": "secret123",
"confirm_password": "secret123",
},
allow_redirects=True,
)
return s
def test_signup_short_username_rerenders_with_message(app_server):
r = requests.post(
f"{BASE_URL}/auth/signup",
data={
"username": "ab",
"email": "x@y.zz",
"password": "secret123",
"confirm_password": "secret123",
},
allow_redirects=False,
)
assert r.status_code == 400
assert "Username must be between 3 and 32 characters" in r.text