phase2: add modular apps, auth scaffolding, and base template routing

This commit is contained in:
Alfredo Di Stasio
2026-03-10 10:27:40 +01:00
parent 35686bdb66
commit f47ffe6c15
63 changed files with 594 additions and 24 deletions

23
tests/test_auth.py Normal file
View File

@ -0,0 +1,23 @@
import pytest
from django.contrib.auth.models import User
from django.urls import reverse
@pytest.mark.django_db
def test_signup_creates_user(client):
payload = {
"username": "scout1",
"email": "scout1@example.com",
"password1": "StrongPass12345",
"password2": "StrongPass12345",
}
response = client.post(reverse("users:signup"), data=payload)
assert response.status_code == 302
assert User.objects.filter(username="scout1").exists()
@pytest.mark.django_db
def test_dashboard_requires_authentication(client):
response = client.get(reverse("core:dashboard"))
assert response.status_code == 302
assert reverse("users:login") in response.url

View File

@ -4,6 +4,6 @@ from django.urls import reverse
@pytest.mark.django_db
def test_health_endpoint(client):
response = client.get(reverse("health"))
response = client.get(reverse("core:health"))
assert response.status_code == 200
assert response.json()["status"] == "ok"