Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 1 of 1 for test_redirect (0.04 sec)

  1. tests/test_tutorial/test_behind_a_proxy/test_tutorial001_01.py

    from fastapi.testclient import TestClient
    
    from docs_src.behind_a_proxy.tutorial001_01_py39 import app
    
    client = TestClient(
        app,
        base_url="https://example.com",
        follow_redirects=False,
    )
    
    
    def test_redirect() -> None:
        response = client.get("/items")
        assert response.status_code == 307
        assert response.headers["location"] == "https://example.com/items/"
    
    
    def test_no_redirect() -> None:
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 544 bytes
    - Viewed (0)
Back to top