Index: main/waeup.cas/trunk/waeup/cas/tests/test_server.py
===================================================================
--- main/waeup.cas/trunk/waeup/cas/tests/test_server.py	(revision 10414)
+++ main/waeup.cas/trunk/waeup/cas/tests/test_server.py	(revision 10415)
@@ -104,5 +104,5 @@
         req = Request.blank('http://localhost/logout')
         resp = app(req)
-        assert resp.status == '501 Not Implemented'
+        assert resp.status == '200 OK'
 
     def test_login_simple(self):
@@ -217,4 +217,41 @@
         assert resp.status == '200 OK'
         assert b'CAS login successful' in resp.body
+
+    def test_logout_no_cookie(self):
+        # 2.3 logout displays a logout page.
+        app = CASServer()
+        req = Request.blank('https://localhost/logout')
+        resp = app(req)
+        assert resp.status == '200 OK'
+        assert b'logged out' in resp.body
+
+    def test_logout_with_cookie(self):
+        # 2.3 logout destroys any existing SSO session
+        app = CASServer()
+        tgc = create_tgc_value()
+        app.db.add(tgc)
+        value = str(tgc.value)
+        req = Request.blank('https://localhost/logout')
+        req.headers['Cookie'] = 'cas-tgc=%s' % value
+        resp = app(req)
+        assert resp.status == '200 OK'
+        assert b'logged out' in resp.body
+        assert 'Set-Cookie' in resp.headers
+        cookie = resp.headers['Set-Cookie']
+        assert cookie.startswith('cas-tgc=;')
+        assert 'expires' in cookie
+        assert 'Max-Age' in cookie
+        assert len(list(app.db.query(TicketGrantingCookie))) == 0
+
+    def test_logout_url(self):
+        # 2.3.1 with an `url` given we provide a link on logout
+        app = CASServer()
+        params = 'url=http%3A%2F%2Fwww.logout.com'
+        req = Request.blank('https://localhost/logout?%s' % params)
+        resp = app(req)
+        assert resp.status == '200 OK'
+        assert b'logged out' in resp.body
+        assert b'like you to' in resp.body
+        assert b'http://www.logout.com' in resp.body
 
 
