> For the complete documentation index, see [llms.txt](https://ultimatewebsolutions.gitbook.io/qa-knowledge-base/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ultimatewebsolutions.gitbook.io/qa-knowledge-base/api-testing-with-python/how-do-you-test-negative-scenarios.md).

# How do you test negative scenarios?

```python
def test_invalid_user():
    response = requests.get(
        "/users/999999"
    )

    assert response.status_code == 404
```
