def test_403(settings: SettingsWrapper, client: Client) -> None: settings.DEBUG = False response: HttpResponse = client.get(path="/error/403/") assertContains(response, "403 Forbidden", status_code=HTTPStatus.FORBIDDEN) assertContains(response, "Request forbidden -- authorization will not help", status_code=HTTPStatus.FORBIDDEN)
def test_404(settings: SettingsWrapper, client: Client) -> None: settings.DEBUG = False response: HttpResponse = client.get(path="/error/404/") assertContains(response, "404 Not Found", status_code=HTTPStatus.NOT_FOUND) assertContains(response, "Nothing matches the given URI", status_code=HTTPStatus.NOT_FOUND)
def test_400(settings: SettingsWrapper, client: Client) -> None: settings.DEBUG = False response: HttpResponse = client.get(path="/error/400/") assertContains(response, "400 Bad Request", status_code=HTTPStatus.BAD_REQUEST) assertContains(response, "Bad request syntax or unsupported method", status_code=HTTPStatus.BAD_REQUEST)