Commit b7f2674b authored by Andreas Valder's avatar Andreas Valder
Browse files

added a test for adding a new course

parent d7db07d2
......@@ -8,15 +8,12 @@ import flask
from flask import url_for
class VideoTestCase(unittest.TestCase):
def setUpClass(cls): = True
def tearDownClass(cls):
def setUp(self): = True =
def test_index(self):
......@@ -61,6 +58,18 @@ class VideoTestCase(unittest.TestCase):
assert r.status_code == 302
assert '<a href="/">' in
def test_edit(self):
with as c:
with c.session_transaction() as sess:
sess['user'] = {'name': 'videoag', '_csrf_token': 'asd', 'dbid': 72}
sess['_csrf_token'] = 'asd'
# add course
r = c.get('/internal/new/courses', data={'title': 'Neue Veranstaltung totalyrandomcrap', 'responsible': 'foo', 'handle': '2r5sQDFCRT3DG', '_csrf_token': 'asd'})
assert r.status_code == 200
r ='/courses')
assert r.status_code == 200
assert 'Neue Veranstaltung totalyrandomcrap' in and '2r5sQDFCRT3DG' in
def test_legacyurl(self):
with as c:
r ='/site/feed.php?newcourses')
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment