From d7db07d2d096758bd76b01d2371133947ee08758 Mon Sep 17 00:00:00 2001
From: Andreas <andreasv@fsmpi.rwth-aachen.de>
Date: Sat, 2 Dec 2017 22:02:04 +0100
Subject: [PATCH] added logout test

---
 tests.py | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/tests.py b/tests.py
index 32d6fd7..b322a09 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:
-- 
GitLab