django-ninja
django-ninja copied to clipboard
TestClient does not use data as query parameters in a get request
Why does TestClient use the data parameter only for the post request. For a get request, it is not added as query parameters?
@iforvard could you provide an example ?
django test client convert data to QUERY_STRING django/test/client.py
def get(self, path, data=None, secure=False, **extra):
"""Construct a GET request."""
data = {} if data is None else data
return self.generic(
"GET",
path,
secure=secure,
**{
"QUERY_STRING": urlencode(data, doseq=True),
**extra,
},
)
django ninja test client not using data https://github.com/vitalik/django-ninja/blob/cc35a8c15c42a855e55bd8d24972a11ecdefa1da/ninja/testing/client.py#L133