Ignore:
Timestamp:
5 Jul 2013, 10:45:41 (12 years ago)
Author:
uli
Message:

Service tickets now store SSO flag in db.

File:
1 edited

Legend:

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

    r10394 r10406  
    9696    def test_add_service_ticket(self):
    9797        # we can add service tickets
    98         self.db.add(ServiceTicket('foo', 'bar', 'baz', 12.1))
    99         result = [(x.ticket, x.user, x.service, x.ts)
     98        self.db.add(ServiceTicket('foo', 'bar', 'baz', False, 12.1))
     99        result = [(x.ticket, x.user, x.service, x.sso, x.ts)
    100100                  for x in self.db.query(ServiceTicket)]
    101         assert result == [('foo', 'bar', 'baz', 12.1)]
     101        assert result == [('foo', 'bar', 'baz', False, 12.1)]
    102102
    103103    def test_service_ticket_repr(self):
    104104        # we can get a proper ServiceTicket representation
    105105        # (i.e. one that can be fed to `eval`)
    106         sticket = ServiceTicket('foo', 'bar', 'baz', 12.1)
     106        sticket = ServiceTicket('foo', 'bar', 'baz', True, 12.1)
    107107        st_repr = sticket.__repr__()
    108         assert st_repr == "ServiceTicket('foo', 'bar', 'baz', 12.1)"
     108        assert st_repr == "ServiceTicket('foo', 'bar', 'baz', True, 12.1)"
    109109
    110110    def test_service_ticket_timestamp(self):
     
    112112        sticket = ServiceTicket('foo', 'bar', 'baz')
    113113        assert isinstance(sticket.ts, float)
     114
     115
     116    def test_service_ticket_sso(self):
     117        # sso is set to True by default
     118        sticket = ServiceTicket('foo', 'bar', 'baz')
     119        assert sticket.sso is True
    114120
    115121    def test_ticket_granting_cookie_add(self):
Note: See TracChangeset for help on using the changeset viewer.