soup = bs4.BeautifulSoup(result.data, 'html.parser')
self.assertEqual(soup.title.text, 'Koordinaten-Rechner')
+ def test_coordtool_convert_ok(self):
+ result = self.app.post('/coordtool/convert', data={'input': '47.987, 11.123'}, 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.assertEqual(soup.title.text, 'Koordinaten-Rechner')
+ self.assertIn('GPX Format', str(soup))
+
+ def test_coordtool_convert_error(self):
+ result = self.app.post('/coordtool/convert', data={'input': 'abc'}, 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.assertEqual(soup.title.text, 'Koordinaten-Rechner')
+ self.assertIn('no known format', str(soup))
+
class TestDbWradmin(WradminTestBase):
def setUp(self):
self.assertIn('Meißner', str(soup))
def test_gasthaus_update(self):
- result = self.app.get('/gasthaus/update')
+ result = self.app.get('/gasthaus/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('Hühnerspiel', str(soup))
def test_rodelbahn_update(self):
- result = self.app.get('/rodelbahn/update')
+ 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_regioncache(self):
- result = self.app.get('/rodelbahn/update_regioncache')
+ result = self.app.get('/rodelbahn/update_regioncache', follow_redirects=True)
self.assertEqual(result.status_code, 200)
self.assertTrue(result.data.startswith(b'<!DOCTYPE html'))
soup = bs4.BeautifulSoup(result.data, 'html.parser')