0001-oidc-authn-include-a-status-code-in-httmock-response.patch
tests/test_auth_oidc.py | ||
---|---|---|
209 | 209 |
'headers': { |
210 | 210 |
'content-type': 'application/json', |
211 | 211 |
}, |
212 |
'status_code': 200, |
|
212 | 213 |
} |
213 | 214 |
else: |
214 | 215 |
return { |
... | ... | |
216 | 217 |
'headers': { |
217 | 218 |
'content-type': 'application/json', |
218 | 219 |
}, |
219 |
'status': 400, |
|
220 |
'status_code': 400,
|
|
220 | 221 |
} |
221 | 222 | |
222 | 223 |
@urlmatch(netloc=userinfo_endpoint.netloc, path=userinfo_endpoint.path) |
... | ... | |
235 | 236 |
'headers': { |
236 | 237 |
'content-type': 'application/json', |
237 | 238 |
}, |
239 |
'status_code': 200, |
|
238 | 240 |
} |
239 | 241 | |
240 | 242 |
@urlmatch(netloc=token_revocation_endpoint.netloc, path=token_revocation_endpoint.path) |
241 | 243 |
def token_revocation_endpoint_mock(url, request): |
242 | 244 |
query = urlparse.parse_qs(request.body) |
243 | 245 |
assert 'token' in query |
244 |
return {} |
|
246 |
return { |
|
247 |
'status_code': 200, |
|
248 |
} |
|
245 | 249 |
return HTTMock(token_endpoint_mock, user_info_endpoint_mock, token_revocation_endpoint_mock) |
246 | 250 | |
247 | 251 | |
... | ... | |
295 | 299 |
User = get_user_model() |
296 | 300 |
assert User.objects.count() == 0 |
297 | 301 | |
298 |
with utils.check_log(caplog, 'invalid token endpoint response'):
|
|
302 |
with utils.check_log(caplog, 'client error while contacting the token_endpoint'):
|
|
299 | 303 |
with oidc_provider_mock(oidc_provider, oidc_provider_jwkset, code): |
300 | 304 |
response = app.get(login_callback_url, params={'code': 'yyyy', 'state': query['state']}) |
301 | 305 |
with utils.check_log(caplog, 'invalid id_token %r'): |
302 |
- |