(factory, server, client)
| 133 | |
| 134 | |
| 135 | def test_unauthorized_client(factory, server, client): |
| 136 | client.grant_type = "invalid" |
| 137 | client.save() |
| 138 | request = factory.post( |
| 139 | "/oauth/token", |
| 140 | data={ |
| 141 | "grant_type": "password", |
| 142 | "username": "foo", |
| 143 | "password": "ok", |
| 144 | }, |
| 145 | HTTP_AUTHORIZATION=create_basic_auth("client-id", "client-secret"), |
| 146 | ) |
| 147 | resp = server.create_token_response(request) |
| 148 | assert resp.status_code == 400 |
| 149 | data = json.loads(resp.content) |
| 150 | assert data["error"] == "unauthorized_client" |
| 151 | |
| 152 | |
| 153 | def test_authorize_token(factory, server): |
nothing calls this directly
no test coverage detected
searching dependent graphs…