Changeset 10398 for main/waeup.cas/trunk/waeup/cas/tests
- Timestamp:
- 4 Jul 2013, 22:08:53 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.cas/trunk/waeup/cas/tests/test_server.py
r10397 r10398 12 12 CASServer, create_service_ticket, create_login_ticket, 13 13 create_tgc_value, check_login_ticket, set_session_cookie, 14 check_session_cookie, 14 15 ) 15 16 16 17 17 RE_ALPHABET = re.compile('^[a-zA-Z0-9\-]*$') … … 184 184 assert b'ticket=ST-' in resp.body 185 185 186 def test_login_cred_acceptor_sso_no_service(self): 187 # 2.2.4: successful login via single sign on 188 db = self.raw_app.db 189 tgc = create_tgc_value() 190 db.add(tgc) 191 value = str(tgc.value) 192 resp = self.app.get('/login', headers={'Cookie': 'cas-tgc=%s' % value}) 193 assert resp.status == '200 OK' 194 assert b'already' in resp.body 195 assert 'Set-Cookie' not in resp.headers 196 return 197 186 198 def test_login_cred_acceptor_failed(self): 187 199 # 2.2.4: failed login yields a message … … 269 281 TicketGrantingCookie.value == value) 270 282 assert len(list(q)) == 1 283 284 def test_check_session_cookie(self): 285 db = DB('sqlite:///') 286 tgc = create_tgc_value() 287 db.add(tgc) 288 value = tgc.value 289 assert check_session_cookie(db, value) == tgc 290 assert check_session_cookie(db, 'foo') is None 291 assert check_session_cookie(db, b'foo') is None 292 value2 = value.encode('utf-8') 293 assert check_session_cookie(db, value2) == tgc
Note: See TracChangeset for help on using the changeset viewer.