diff options
author | Emmanuel Raviart <eraviart@entrouvert.com> | 2004-08-06 16:43:27 +0000 |
---|---|---|
committer | Emmanuel Raviart <eraviart@entrouvert.com> | 2004-08-06 16:43:27 +0000 |
commit | bf8d4c3651a1f916446d1b1e338bcf392162b73b (patch) | |
tree | c8bb5d512bc40b9eeb658a8fd6410688627100b0 /python | |
parent | f437999e7767d548a8a9dda5d82754a1aac749b5 (diff) | |
download | lasso-bf8d4c3651a1f916446d1b1e338bcf392162b73b.tar.gz lasso-bf8d4c3651a1f916446d1b1e338bcf392162b73b.tar.xz lasso-bf8d4c3651a1f916446d1b1e338bcf392162b73b.zip |
New Python tests.
Diffstat (limited to 'python')
-rw-r--r-- | python/tests/login_tests.py | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/python/tests/login_tests.py b/python/tests/login_tests.py index 74b9ad2c..e5f4e405 100644 --- a/python/tests/login_tests.py +++ b/python/tests/login_tests.py @@ -133,7 +133,7 @@ class LoginTestCase(unittest.TestCase): self.failUnlessEqual(httpResponse.statusCode, 200) def test03(self): - """Service provider initiated login using HTTP redirect, but user fail to authenticate himself on identity provider.""" + """Service provider initiated login using HTTP redirect, but user fail to authenticate himself on identity provider. Then logout, with same problem.""" internet = Internet() idpSite = self.generateIdpSite(internet) @@ -145,6 +145,25 @@ class LoginTestCase(unittest.TestCase): httpResponse = spSite.doHttpRequest(HttpRequest(principal, 'GET', '/loginUsingRedirect')) self.failUnlessEqual(httpResponse.statusCode, 401) + httpResponse = spSite.doHttpRequest(HttpRequest(principal, 'GET', '/logoutUsingSoap')) + self.failUnlessEqual(httpResponse.statusCode, 401) + + def test04(self): + """Service provider initiated login using HTTP redirect, but user has no account on service + provider and doesn't create one.""" + + internet = Internet() + idpSite = self.generateIdpSite(internet) + spSite = self.generateSpSite(internet) + spSite.idpSite = idpSite + principal = Principal(internet, 'Christophe Nowicki') + principal.keyring[idpSite.url] = 'Nowicki' + # Christophe Nowicki has no account on service provider. + + httpResponse = spSite.doHttpRequest(HttpRequest(principal, 'GET', '/loginUsingRedirect')) + self.failUnlessEqual(httpResponse.statusCode, 401) + httpResponse = spSite.doHttpRequest(HttpRequest(principal, 'GET', '/logoutUsingSoap')) + self.failUnlessEqual(httpResponse.statusCode, 401) ## def test06(self): ## """Service provider LECP login.""" |