tests: adapt to changes in django-webtest

This commit is contained in:
Benjamin Dauvergne 2017-03-22 23:00:49 +01:00
parent 58c37fc117
commit 0aae0ad4dd
2 changed files with 4 additions and 4 deletions

View File

@ -107,7 +107,7 @@ def test_sso_slo(db, app, idp, caplog, sp_settings):
response = app.get(reverse('mellon_login'))
url, body = idp.process_authn_request_redirect(response['Location'])
assert url.endswith(reverse('mellon_login'))
response = app.post(reverse('mellon_login'), {'SAMLResponse': body})
response = app.post(reverse('mellon_login'), params={'SAMLResponse': body})
assert 'created new user' in caplog.text()
assert 'logged in using SAML' in caplog.text()
assert response['Location'].endswith(sp_settings.LOGIN_REDIRECT_URL)
@ -117,7 +117,7 @@ def test_sso(db, app, idp, caplog, sp_settings):
response = app.get(reverse('mellon_login'))
url, body = idp.process_authn_request_redirect(response['Location'])
assert url.endswith(reverse('mellon_login'))
response = app.post(reverse('mellon_login'), {'SAMLResponse': body})
response = app.post(reverse('mellon_login'), params={'SAMLResponse': body})
assert 'created new user' in caplog.text()
assert 'logged in using SAML' in caplog.text()
assert response['Location'].endswith(sp_settings.LOGIN_REDIRECT_URL)
@ -127,7 +127,7 @@ def test_sso_request_denied(db, app, idp, caplog, sp_settings):
response = app.get(reverse('mellon_login'))
url, body = idp.process_authn_request_redirect(response['Location'], auth_result=False)
assert url.endswith(reverse('mellon_login'))
response = app.post(reverse('mellon_login'), {'SAMLResponse': body})
response = app.post(reverse('mellon_login'), params={'SAMLResponse': body})
assert "status is not success codes: [u'urn:oasis:names:tc:SAML:2.0:status:Responder',\
u'urn:oasis:names:tc:SAML:2.0:status:RequestDenied']" in caplog.text()

View File

@ -19,7 +19,7 @@ pytestmark = pytest.mark.django_db
def test_null_character_on_samlresponse_post(app):
app.post(reverse('mellon_login'), {'SAMLResponse': '\x00'}, status=400)
app.post(reverse('mellon_login'), params={'SAMLResponse': '\x00'}, status=400)
def test_metadata(private_settings, client):