0002-tests-replace-norequest-decorator-by-explicit-functi.patch
tests/test_auth_oidc.py | ||
---|---|---|
812 | 812 |
app.cookiejar.clear() |
813 | 813 | |
814 | 814 |
caplog.clear() |
815 |
with utils.norequest: |
|
815 | ||
816 |
@urlmatch() |
|
817 |
def norequest(url, request): |
|
818 |
assert False, 'no request should be done' |
|
819 | ||
820 |
with HTTMock(norequest): |
|
816 | 821 |
response = app.get(login_callback_url(oidc_provider), params={'code': code, 'state': state}) |
822 | ||
817 | 823 |
# not logged |
818 | 824 |
assert re.match('^auth-oidc: state.*has been lost', caplog.records[-1].message) |
819 | 825 |
# event is recorded |
tests/utils.py | ||
---|---|---|
300 | 300 |
) |
301 | 301 |
elif data and count > 1: |
302 | 302 |
assert qs.filter(**{'data__' + k: v for k, v in data.items()}).count() == 1 |
303 | ||
304 | ||
305 |
@httmock.HTTMock |
|
306 |
@httmock.urlmatch() |
|
307 |
def norequest(request, url): |
|
308 |
assert False, 'no request should be done' |
|
309 |
- |