17 lines
453 B
Python
17 lines
453 B
Python
"""ping endpoint 集成测试:同步 client + adrf async view。"""
|
|
|
|
import pytest
|
|
from django.test import Client
|
|
|
|
|
|
@pytest.mark.django_db
|
|
def test_ping_returns_ok():
|
|
client = Client()
|
|
response = client.get("/api/v1/ping/")
|
|
assert response.status_code == 200
|
|
data = response.json()
|
|
assert data["ok"] is True
|
|
assert data["service"] == "dealerhub"
|
|
assert "django" in data["versions"]
|
|
assert "granian" in data["versions"]
|