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

11 lines
246 B
Python
Raw Permalink Normal View History

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