soup = bs4.BeautifulSoup(result.data, 'html.parser')
self.assertEqual(soup.title.text, 'Rodelbahnberichte')
+ def test_bericht_view(self):
+ result = self.app.get('/bericht/view/19591')
+ self.assertEqual(result.status_code, 200)
+ self.assertTrue(result.data.startswith(b'<!DOCTYPE html'))
+ soup = bs4.BeautifulSoup(result.data, 'html.parser')
+ self.assertEqual(soup.title.text, 'Rodelbahnbericht')
+ self.assertIn('Brandstatt Alm', str(soup.table))
+
+ def test_gasthaus_list(self):
+ result = self.app.get('/gasthaus/list')
+ self.assertEqual(result.status_code, 200)
+ self.assertTrue(result.data.startswith(b'<!DOCTYPE html'))
+ soup = bs4.BeautifulSoup(result.data, 'html.parser')
+ self.assertEqual(soup.title.text, 'Gasthäuser')
+ self.assertIn('Meißner', str(soup.table))
+
+ def test_gasthaus_view(self):
+ result = self.app.get('/gasthaus/view/362')
+ self.assertEqual(result.status_code, 200)
+ self.assertTrue(result.data.startswith(b'<!DOCTYPE html'))
+ soup = bs4.BeautifulSoup(result.data, 'html.parser')
+ self.assertEqual(soup.title.text, 'Gasthaus')
+ self.assertIn('Meißner', str(soup))
+
+ def test_gasthaus_update(self):
+ result = self.app.get('/gasthaus/update')
+ self.assertEqual(result.status_code, 200)
+ self.assertTrue(result.data.startswith(b'<!DOCTYPE html'))
+ soup = bs4.BeautifulSoup(result.data, 'html.parser')
+ self.assertIn('Die Gasthausliste wurde erfolgreich aktualisiert.', str(soup))
+
def test_rodelbahn_list(self):
result = self.app.get('/rodelbahn/list')
self.assertEqual(result.status_code, 200)
self.assertIsNotNone(table)
rows = table.find_all('tr')
self.assertEqual(len(rows), 9+1)
+
+ def test_rodelbahn_view(self):
+ result = self.app.get('/rodelbahn/view/926')
+ self.assertEqual(result.status_code, 200)
+ self.assertTrue(result.data.startswith(b'<!DOCTYPE html'))
+ soup = bs4.BeautifulSoup(result.data, 'html.parser')
+ self.assertEqual(soup.title.text, 'Rodelbahn')
+ self.assertIn('Hühnerspiel', str(soup))
+
+ def test_rodelbahn_update(self):
+ result = self.app.get('/rodelbahn/update')
+ 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_regioncache(self):
+ result = self.app.get('/rodelbahn/update_regioncache')
+ self.assertEqual(result.status_code, 200)
+ self.assertTrue(result.data.startswith(b'<!DOCTYPE html'))
+ soup = bs4.BeautifulSoup(result.data, 'html.parser')
+ self.assertIn('Die Rodelbahneinträge in den Regionslisten wurden erfolgreich aktualisiert.', str(soup))