tests: add sso/slo tests, for real
This commit is contained in:
parent
622c0fc012
commit
dd904525f0
|
@ -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/'
|
Loading…
Reference in New Issue