Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 1 of 1 for test_login (0.16 sec)

  1. tests/test_tutorial/test_security/test_tutorial003_an.py

    from docs_src.security.tutorial003_an import app
    
    client = TestClient(app)
    
    
    def test_login():
        response = client.post("/token", data={"username": "johndoe", "password": "secret"})
        assert response.status_code == 200, response.text
        assert response.json() == {"access_token": "johndoe", "token_type": "bearer"}
    
    
    def test_login_incorrect_password():
        response = client.post(
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jul 07 17:12:13 GMT 2023
    - 8K bytes
    - Viewed (0)
Back to top