django rest framework use RequestsClient with pytest

35 Views Asked by At
from rest_framework.test import RequestsClient

@pytest.mark.django_db()
def test(api_client):
    client = RequestsClient()
    response = client.get('http://www.google.com')
    print(response)

response always show 404

maybe RequestsClient should use with LiveServerTestCase. https://github.com/encode/django-rest-framework/issues/5803

0

There are 0 best solutions below