Files
fast_api_template/backend/app/tests/api/routes/test_celery.py
T

17 lines
431 B
Python
Raw Normal View History

2020-04-20 20:31:29 +02:00
from fastapi.testclient import TestClient
from app.core.config import settings
2020-04-20 20:31:29 +02:00
def test_celery_worker_test(
2024-02-25 19:39:33 +01:00
client: TestClient, superuser_token_headers: dict[str, str]
2020-04-20 20:31:29 +02:00
) -> None:
data = {"message": "test"}
2020-04-20 20:31:29 +02:00
r = client.post(
f"{settings.API_V1_STR}/utils/test-celery/",
json=data,
headers=superuser_token_headers,
)
response = r.json()
assert response["message"] == "Word received"