MCPcopy
hub / github.com/authlib/authlib / test_authorize_token

Function test_authorize_token

tests/django/test_oauth2/test_password_grant.py:153–166  ·  view source on GitHub ↗
(factory, server)

Source from the content-addressed store, hash-verified

151
152
153def test_authorize_token(factory, server):
154 request = factory.post(
155 "/oauth/token",
156 data={
157 "grant_type": "password",
158 "username": "foo",
159 "password": "ok",
160 },
161 HTTP_AUTHORIZATION=create_basic_auth("client-id", "client-secret"),
162 )
163 resp = server.create_token_response(request)
164 assert resp.status_code == 200
165 data = json.loads(resp.content)
166 assert "access_token" in data

Callers

nothing calls this directly

Calls 3

create_basic_authFunction · 0.85
postMethod · 0.80
create_token_responseMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…