tests: add sso/slo tests, for real

This commit is contained in:
Frédéric Péters 2016-07-22 14:55:26 +02:00
parent 622c0fc012
commit dd904525f0
1 changed files with 21 additions and 0 deletions

21
tests/test_sso.py Normal file
View File

@ -0,0 +1,21 @@
import pytest
from webtest import TestApp
from django.test import override_settings
from chrono.wsgi import application
pytestmark = pytest.mark.django_db
def test_sso(app):
with override_settings(MELLON_IDENTITY_PROVIDERS=[{'METADATA': 'x', 'ENTITY_ID': 'x'}]):
resp = app.get('/login/')
assert resp.location == 'http://localhost:80/accounts/mellon/login/'
resp = app.get('/login/?next=/manage/')
assert resp.location == 'http://localhost:80/accounts/mellon/login/?next=/manage/'
def test_slo(app):
with override_settings(MELLON_IDENTITY_PROVIDERS=[{'METADATA': 'x', 'ENTITY_ID': 'x'}]):
resp = app.get('/logout/')
assert resp.location == 'http://localhost:80/accounts/mellon/logout/'