language-learning-app/api/tests/test_article_router.py
2026-06-02 21:02:50 +01:00

20 lines
675 B
Python

import httpx
from fastapi.testclient import TestClient
from app.main import app
def test_create_article(authd_client: httpx.Client):
create_summary_article_response = authd_client.post("/api/articles", json={
"article_type": "summary",
"target_language": "fr",
"competency_level": "B2",
"target_word_count_range": "250-300",
"input_text": "This is an example of a very long text"
})
assert create_summary_article_response.status_code == 201
article_id = create_summary_article_response.json().get("id")
get_response = authd_client.get(f"/api/articles/{article_id}")
assert get_response.status_code == 200