As of the latest version v0.21.0, None values in data lookups don't work:
import httpx
import respx
@respx.mock
def test():
data = {"test": None}
respx.post("http://test.com", data=data).respond()
response = httpx.post("http://test.com", data=data)
assert response.status_code == 200
if __name__ == "__main__":
test()
output:
respx.models.AllMockedAssertionError: RESPX: <Request('POST', 'http://test.com/')> not mocked!
This test passes successfully in v0.20.2
The following do work:
data = {"test": ""}
respx.post("http://test.com", data=data).respond()
response = httpx.post("http://test.com", data=data)
respx.post("http://test.com", data={"test": ""}).respond()
response = httpx.post("http://test.com", data={"test": None})
So there's just a bug somewhere translating None to ""
As of the latest version
v0.21.0, None values in data lookups don't work:output:
This test passes successfully in
v0.20.2The following do work:
So there's just a bug somewhere translating None to ""