Add test checking the number of returned entries.
authorphilipp <philipp@7aebc617-e5e2-0310-91dc-80fb5f6d2477>
Sun, 23 Jul 2017 19:23:58 +0000 (19:23 +0000)
committerphilipp <philipp@7aebc617-e5e2-0310-91dc-80fb5f6d2477>
Sun, 23 Jul 2017 19:23:58 +0000 (19:23 +0000)
git-svn-id: http://www.winterrodeln.org/svn/wrfeed/trunk@2653 7aebc617-e5e2-0310-91dc-80fb5f6d2477

tests/test_wrfeed.py

index 29ed517563112e4e462f345d411f5095c47583c5..463afa1ac9124375c1d984158c7724687d3eaba3 100644 (file)
@@ -1,4 +1,5 @@
 import unittest
+import xml.etree.ElementTree as et
 import sqlalchemy
 from sqlalchemy.engine.url import URL, make_url
 import wrfeed
@@ -55,3 +56,6 @@ class TestDbWrfeed(WrfeedTestBase):
     def test_alle(self):
         result = self.app.get('/berichte/alle')
         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')), 7)