After sending an HTTP request with Requests, it is common to check the status code of the response.
import requests
response = requests.get(...)
assert response.status_code == 200
And so on. However, at this time, using the Requests constant,
assert response.status_code == requests.codes.ok
And so on. This way you don't have to use the magic number 200.
Recommended Posts