root = et.fromstring(result.data)
self.assertIn('Rodelbahnberichte', root.find('{http://www.w3.org/2005/Atom}title').text)
self.assertEqual(len(root.findall('{http://www.w3.org/2005/Atom}entry')), 7)
+
+ def test_bahn(self):
+ bahn_count = {
+ 'haunold': 1,
+ 'pleisenhütte_axamer_lizum': 2,
+ 'prantner_alm': 0,
+ 'birgitzer_alm_(vom_adelshof)': 1,
+ }
+ for bahn, count in bahn_count.items():
+ result = self.app.get('/berichte/bahn/{}'.format(bahn))
+ self.assertTrue(result.data.startswith(b'<?xml'))
+ root = et.fromstring(result.data)
+ self.assertIn('Rodelbahnberichte', root.find('{http://www.w3.org/2005/Atom}title').text)
+ self.assertEqual(len(root.findall('{http://www.w3.org/2005/Atom}entry')), count, '"{}" not found {} times'.format(bahn, count))