Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 3 of 3 for get_settings_override (0.2 sec)

  1. docs_src/settings/app02/test_main.py

    from fastapi.testclient import TestClient
    
    from .config import Settings
    from .main import app, get_settings
    
    client = TestClient(app)
    
    
    def get_settings_override():
        return Settings(admin_email="******@****.***")
    
    
    app.dependency_overrides[get_settings] = get_settings_override
    
    
    def test_app():
        response = client.get("/info")
        data = response.json()
        assert data == {
            "app_name": "Awesome API",
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Thu Jul 29 09:26:07 UTC 2021
    - 515 bytes
    - Viewed (0)
  2. docs_src/settings/app02_an/test_main.py

    from fastapi.testclient import TestClient
    
    from .config import Settings
    from .main import app, get_settings
    
    client = TestClient(app)
    
    
    def get_settings_override():
        return Settings(admin_email="******@****.***")
    
    
    app.dependency_overrides[get_settings] = get_settings_override
    
    
    def test_app():
        response = client.get("/info")
        data = response.json()
        assert data == {
            "app_name": "Awesome API",
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sat Mar 18 12:29:59 UTC 2023
    - 515 bytes
    - Viewed (0)
  3. docs_src/settings/app02_an_py39/test_main.py

    from fastapi.testclient import TestClient
    
    from .config import Settings
    from .main import app, get_settings
    
    client = TestClient(app)
    
    
    def get_settings_override():
        return Settings(admin_email="******@****.***")
    
    
    app.dependency_overrides[get_settings] = get_settings_override
    
    
    def test_app():
        response = client.get("/info")
        data = response.json()
        assert data == {
            "app_name": "Awesome API",
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sat Mar 18 12:29:59 UTC 2023
    - 515 bytes
    - Viewed (0)
Back to top