e41094f908
Fixed #12 Fixed #13 Fixed #14
20 lines
466 B
Python
20 lines
466 B
Python
from starlette.testclient import TestClient
|
|
|
|
from server.main import app
|
|
|
|
client = TestClient(app)
|
|
|
|
|
|
def test_i_can_authenticate():
|
|
data = {
|
|
"username": "kodjo",
|
|
"password": "kodjo"
|
|
}
|
|
response = client.post("/token", data=data)
|
|
assert response.status_code == 200
|
|
as_json = response.json()
|
|
assert 'access_token' in as_json
|
|
assert 'first_name' in as_json
|
|
assert 'last_name' in as_json
|
|
assert 'token_type' in as_json
|