diff --git a/tests.py b/tests.py
index 32d6fd7d3130f0d46a11be7db0277dd93b45a6b8..b322a09d383afe5a0e2cbda225ac754022bbab55 100755
--- a/tests.py
+++ b/tests.py
@@ -51,6 +51,15 @@ class VideoTestCase(unittest.TestCase):
 			assert flask.session['user']
 			assert r.status_code == 403
 			assert 'Login fehlgeschlagen' in r.data.decode()
+
+	def test_logout(self):
+		with self.app as c:
+			with c.session_transaction() as sess:
+				sess['user'] = {'foo': 'bar'}
+			r = c.get('/internal/logout', data={'ref': '/'})
+			assert not flask.session.get('user')
+			assert r.status_code == 302
+			assert '<a href="/">' in r.data.decode()
 	
 	def test_legacyurl(self):
 		with self.app as c: