I am trying to use snapshottest
for some pytest
s in Python.
The stored snapshot of correct behavior is (and where I suspect the problem lays)
snapshots['test_some_unauthorized 1'] = GenericRepr('<Response [401]>')
def test_some_unauthorized(snapshot):
...
snapshot.assert_match(response)
- this test only reacts on the status code. No matter what content is returned.
However error code does not imply clean data nor any valid error content anyways.
Is there something I am missing? Maybe some "check error response contents"-settings or something?
(BTW: I know I can bypass this with checking the response content directly explicitly somewhat likeassert response.text == "..."
, however I wanted to use snapshottest to avoid doing exactly that, so my question aim is really how to do this using snapshot)