From: Philipp Spitzer Date: Tue, 29 Sep 2020 19:47:15 +0000 (+0200) Subject: Update tests to work with admin requirements. X-Git-Url: https://git.toastfreeware.priv.at/philipp/winterrodeln/wradmin.git/commitdiff_plain/502dd8f4691ff0595068408c894291095d132ad3 Update tests to work with admin requirements. --- diff --git a/tests/test_wradmin.py b/tests/test_wradmin.py index eb8a9cc..35b8a05 100644 --- a/tests/test_wradmin.py +++ b/tests/test_wradmin.py @@ -9,6 +9,9 @@ class WradminTestBase(unittest.TestCase): wradmin.app.config['TESTING'] = True self.app = wradmin.app.test_client() + def login(self): + return self.app.post('/login', data={'user_name': 'Johndoe', 'password': 'doejohn'}, follow_redirects=True) + class TestNoDbWradmin(WradminTestBase): def test_root(self): @@ -19,6 +22,7 @@ class TestNoDbWradmin(WradminTestBase): self.assertEqual(soup.title.text, 'Hauptmenü') def test_coordtool(self): + self.login() result = self.app.get('/coordtool/index') self.assertEqual(result.status_code, 200) self.assertTrue(result.data.startswith(b'