Projet

Général

Profil

0002-tests-replace-norequest-decorator-by-explicit-functi.patch

Valentin Deniaud, 21 septembre 2021 17:09

Télécharger (1,52 ko)

Voir les différences:

Subject: [PATCH 02/59] tests: replace norequest decorator by explicit function
 (#56982)

 tests/test_auth_oidc.py | 8 +++++++-
 tests/utils.py          | 6 ------
 2 files changed, 7 insertions(+), 7 deletions(-)
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
-