]> ToastFreeware Gitweb - philipp/winterrodeln/wradmin.git/commitdiff
Now the failure mode when updating sledruns is tested as well.
authorphilipp <philipp@7aebc617-e5e2-0310-91dc-80fb5f6d2477>
Fri, 10 May 2019 22:14:48 +0000 (22:14 +0000)
committerphilipp <philipp@7aebc617-e5e2-0310-91dc-80fb5f6d2477>
Fri, 10 May 2019 22:14:48 +0000 (22:14 +0000)
git-svn-id: http://www.winterrodeln.org/svn/wradmin/trunk@2810 7aebc617-e5e2-0310-91dc-80fb5f6d2477

tests/test_wradmin.py

index f9963dd4576f9db1cb10509187344e682be0496f..53b6fe464f57426fc457c93e9cc014cf7fb576a0 100644 (file)
@@ -153,13 +153,24 @@ class TestDbWradmin(WradminTestBase):
         self.assertIn('Rodelbahn', soup.title.text)
         self.assertIn('Hühnerspiel', str(soup))
 
-    def test_rodelbahn_update(self):
+    def test_rodelbahn_update_success(self):
         result = self.app.get('/rodelbahn/update', follow_redirects=True)
         self.assertEqual(result.status_code, 200)
         self.assertTrue(result.data.startswith(b'<!doctype html'))
         soup = bs4.BeautifulSoup(result.data, 'html.parser')
         self.assertIn('Die Rodelbahnliste wurde erfolgreich aktualisiert.', str(soup))
 
+    def test_rodelbahn_update_fail(self):
+        session = wradmin.model.meta.Session
+        text = session.query(wradmin.model.MwText).get(12106)
+        text.old_text = text.old_text.replace('Schwierigkeit        = mittel', 'Schwierigkeit        = geht so')
+        session.commit()
+        result = self.app.get('/rodelbahn/update', follow_redirects=True)
+        self.assertEqual(result.status_code, 200)
+        self.assertTrue(result.data.startswith(b'<!doctype html'))
+        soup = bs4.BeautifulSoup(result.data, 'html.parser')
+        self.assertIn('Fehler bei Rodelbahn \'Juifenalm\'', str(soup))
+
     def test_rodelbahn_update_regioncache(self):
         result = self.app.get('/rodelbahn/update_regioncache', follow_redirects=True)
         self.assertEqual(result.status_code, 200)