example-of-crud-in-django-w.../tests/test_ping.py

9 lines
244 B
Python
Raw Normal View History

2021-07-05 15:56:53 +02:00
import json
from django.urls import reverse
def test_ping(client):
url = reverse("ping")
response = client.get(url)
content = json.loads(response.content)
assert response.status_code == 200
assert content["ping"] == "pong!"