Add .env.example with configuration for database, Redis, security, SMTP, workers, and plugins. Add .gitignore for Python, Node.js, Next.js, Docker volumes, and IDE files. Add MIT License. Update README.md with feature overview, quick start guide, architecture description, plugin system documentation, security details, backup/restore instructions, and developer setup. Add Alembic configuration files and placeholder directories for API, web, worker, and plugin components
33 lines
857 B
Python
33 lines
857 B
Python
import pytest
|
|
|
|
|
|
@pytest.fixture
|
|
def setup_response(client):
|
|
return client.post("/api/v1/auth/setup", json={
|
|
"email": "owner@nexadash.local",
|
|
"password": "StrongPassword123!",
|
|
"first_name": "Owner",
|
|
"last_name": "User",
|
|
})
|
|
|
|
|
|
def test_setup_status(client):
|
|
r = client.get("/api/v1/auth/setup-status")
|
|
assert r.status_code == 200
|
|
assert "setup_required" in r.json()
|
|
|
|
|
|
def test_setup(client, setup_response):
|
|
assert setup_response.status_code in (200, 400)
|
|
if setup_response.status_code == 200:
|
|
assert "access_token" in setup_response.json()
|
|
|
|
|
|
def test_login(client, setup_response):
|
|
r = client.post("/api/v1/auth/login", json={
|
|
"email": "owner@nexadash.local",
|
|
"password": "StrongPassword123!",
|
|
})
|
|
assert r.status_code == 200
|
|
assert "access_token" in r.json()
|