Ignore:
Timestamp:
13 Aug 2013, 12:46:28 (11 years ago)
Author:
uli
Message:

Regression test: CAS must allow GET params in service URLs.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.cas/trunk/waeup/cas/tests/test_server.py

    r10416 r10490  
    417417            'http://service.com/?ticket=ST-')
    418418
     419    def test_login_sso_with_service_additional_params1(self):
     420        # we can get a service ticket also with a service providing
     421        # get params
     422        # this service url reads http://service.com/index.php?authCAS=CAS
     423        service_url = 'http%3A%2F%2Fservice.com%2Findex.php%3FauthCAS%3DCAS'
     424        resp1 = self.app.get(
     425            'https://localhost/login?service=%s' % service_url)
     426        assert resp1.status == '200 OK'
     427        assert 'cas-tgc' not in self.app.cookies
     428        form = resp1.forms[0]
     429        form.set('username', 'bird')
     430        form.set('password', 'bebop')
     431        resp2 = form.submit('AUTHENTICATE')
     432        assert resp2.status == '303 See Other'
     433        location = resp2.headers['Location']
     434        ticket_value = location[48:]
     435        exp_location = 'http://service.com/index.php'
     436        exp_location += '?authCAS=CAS&ticket=' + ticket_value
     437        # there is only one ticket value in response location
     438        assert len(ticket_value) == 32
     439        assert location == exp_location
     440
    419441
    420442class CASServerHelperTests(unittest.TestCase):
     
    479501        assert check_login_ticket(db, 'LT-654321') is False
    480502
    481     def test_set_session_cookie(self):
     503    def test_set_session_cookie1(self):
    482504        # make sure we can add session cookies to responses
    483505        db = DB('sqlite:///')
     
    493515        assert len(list(q)) == 1
    494516
    495     def test_check_session_cookie(self):
     517    def test_check_session_cookie2(self):
    496518        db = DB('sqlite:///')
    497519        tgc = create_tgc_value()
Note: See TracChangeset for help on using the changeset viewer.