Hi. I have a two post requests with different payloads:
url = "http://some-url"
mock.post(url, payload={"request": 1})
mock.post(url, payload={"request": 2})
# Make some calls
mock.assert_called_with(
url,
method=HTTPMethod.POST,
json={"request": 1}
)
mock.assert_called_with(
url,
method=HTTPMethod.POST,
json={"request": 2}
)
One of assert_called_with calls must be failed, cause in https://github.com/pnuckowski/aioresponses/blob/master/aioresponses/core.py#L389 we search only last request by (url, method)