Skip to content
Snippets Groups Projects
Commit 435c1303 authored by Andreas Valder's avatar Andreas Valder
Browse files

added test to add a course as not logged in user

parent b7f2674b
No related branches found
No related tags found
No related merge requests found
...@@ -60,9 +60,15 @@ class VideoTestCase(unittest.TestCase): ...@@ -60,9 +60,15 @@ class VideoTestCase(unittest.TestCase):
def test_edit(self): def test_edit(self):
with self.app as c: with self.app as c:
# test auth
r = c.get('/internal/new/courses', data={'title': 'Neue Vera14352345nstaltung totalyrandomcrap', 'responsible': 'foo', 'handle': '2r5sQ46z4w3DFCRT3<F4>DG', '_csrf_token': 'asd'})
assert r.status_code != 200
# all other tests are done logged in
with c.session_transaction() as sess: with c.session_transaction() as sess:
sess['user'] = {'name': 'videoag', '_csrf_token': 'asd', 'dbid': 72} sess['user'] = {'name': 'videoag', '_csrf_token': 'asd', 'dbid': 72}
sess['_csrf_token'] = 'asd' sess['_csrf_token'] = 'asd'
# add course # add course
r = c.get('/internal/new/courses', data={'title': 'Neue Veranstaltung totalyrandomcrap', 'responsible': 'foo', 'handle': '2r5sQDFCRT3DG', '_csrf_token': 'asd'}) r = c.get('/internal/new/courses', data={'title': 'Neue Veranstaltung totalyrandomcrap', 'responsible': 'foo', 'handle': '2r5sQDFCRT3DG', '_csrf_token': 'asd'})
assert r.status_code == 200 assert r.status_code == 200
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment