Changeset 10406 for main/waeup.cas/trunk/waeup/cas/tests
- Timestamp:
- 5 Jul 2013, 10:45:41 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.cas/trunk/waeup/cas/tests/test_db.py
r10394 r10406 96 96 def test_add_service_ticket(self): 97 97 # 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) 100 100 for x in self.db.query(ServiceTicket)] 101 assert result == [('foo', 'bar', 'baz', 12.1)]101 assert result == [('foo', 'bar', 'baz', False, 12.1)] 102 102 103 103 def test_service_ticket_repr(self): 104 104 # we can get a proper ServiceTicket representation 105 105 # (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) 107 107 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)" 109 109 110 110 def test_service_ticket_timestamp(self): … … 112 112 sticket = ServiceTicket('foo', 'bar', 'baz') 113 113 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 114 120 115 121 def test_ticket_granting_cookie_add(self):
Note: See TracChangeset for help on using the changeset viewer.