]> ToastFreeware Gitweb - philipp/winterrodeln/wradmin.git/commitdiff
Adjust tests: Now all tests are passing.
authorphilipp <philipp@7aebc617-e5e2-0310-91dc-80fb5f6d2477>
Wed, 27 Dec 2017 22:31:26 +0000 (22:31 +0000)
committerphilipp <philipp@7aebc617-e5e2-0310-91dc-80fb5f6d2477>
Wed, 27 Dec 2017 22:31:26 +0000 (22:31 +0000)
git-svn-id: http://www.winterrodeln.org/svn/wradmin/trunk@2767 7aebc617-e5e2-0310-91dc-80fb5f6d2477

tests/test_wradmin.py

index e79ee2ea34a60e0114ed2d888aac667ec16bc33c..e443325e9c4e2c889e337e0ccbaf0a6186a23377 100644 (file)
@@ -17,21 +17,21 @@ class TestNoDbWradmin(WradminTestBase):
     def test_root(self):
         result = self.app.get('/')
         self.assertEqual(result.status_code, 200)
-        self.assertTrue(result.data.startswith(b'<!DOCTYPE html'))
+        self.assertTrue(result.data.startswith(b'<!doctype html'))
         soup = bs4.BeautifulSoup(result.data, 'html.parser')
         self.assertEqual(soup.title.text, 'Hauptmenü')
 
     def test_coordtool(self):
         result = self.app.get('/coordtool/index')
         self.assertEqual(result.status_code, 200)
-        self.assertTrue(result.data.startswith(b'<!DOCTYPE html'))
+        self.assertTrue(result.data.startswith(b'<!doctype html'))
         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'))
+        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))
@@ -39,7 +39,7 @@ class TestNoDbWradmin(WradminTestBase):
     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'))
+        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))
@@ -68,41 +68,41 @@ class TestDbWradmin(WradminTestBase):
     def test_bericht_list(self):
         result = self.app.get('/bericht/list')
         self.assertEqual(result.status_code, 200)
-        self.assertTrue(result.data.startswith(b'<!DOCTYPE html'))
+        self.assertTrue(result.data.startswith(b'<!doctype html'))
         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'))
+        self.assertTrue(result.data.startswith(b'<!doctype html'))
         soup = bs4.BeautifulSoup(result.data, 'html.parser')
-        self.assertEqual(soup.title.text, 'Rodelbahnbericht')
+        self.assertEqual(soup.title.text, 'Rodelbahnbericht #19591')
         self.assertIn('Brandstatt Alm', str(soup.table))
 
     def test_bericht_change_date_invalid_twoweeks(self):
         post_data = {'date_invalid': 'two_weeks', 'date_userdefined': '2018-01-30 18:26'}
         result = self.app.post('/bericht/change_date_invalid/19591', data=post_data, follow_redirects=True)
         self.assertEqual(result.status_code, 200)
-        self.assertTrue(result.data.startswith(b'<!DOCTYPE html'))
+        self.assertTrue(result.data.startswith(b'<!doctype html'))
         soup = bs4.BeautifulSoup(result.data, 'html.parser')
-        self.assertEqual(soup.title.text, 'Rodelbahnbericht')
+        self.assertEqual(soup.title.text, 'Rodelbahnbericht #19591')
         self.assertIn('Datum wurde erfolgreich geändert', str(soup))
 
     def test_bericht_change_date_invalid_userdefined(self):
         post_data = {'date_invalid': 'userdefined', 'date_userdefined': '2018-01-30 15:09'}
         result = self.app.post('/bericht/change_date_invalid/19591', data=post_data, follow_redirects=True)
         self.assertEqual(result.status_code, 200)
-        self.assertTrue(result.data.startswith(b'<!DOCTYPE html'))
+        self.assertTrue(result.data.startswith(b'<!doctype html'))
         soup = bs4.BeautifulSoup(result.data, 'html.parser')
-        self.assertEqual(soup.title.text, 'Rodelbahnbericht')
+        self.assertEqual(soup.title.text, 'Rodelbahnbericht #19591')
         self.assertIn('Datum wurde erfolgreich geändert', str(soup))
         self.assertIn('2018-01-30 15:09:00', str(soup))
 
     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'))
+        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))
@@ -110,22 +110,22 @@ class TestDbWradmin(WradminTestBase):
     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'))
+        self.assertTrue(result.data.startswith(b'<!doctype html'))
         soup = bs4.BeautifulSoup(result.data, 'html.parser')
-        self.assertEqual(soup.title.text, 'Gasthaus')
+        self.assertIn('Gasthaus', soup.title.text)
         self.assertIn('Meißner', str(soup))
 
     def test_gasthaus_update(self):
         result = self.app.get('/gasthaus/update', follow_redirects=True)
         self.assertEqual(result.status_code, 200)
-        self.assertTrue(result.data.startswith(b'<!DOCTYPE html'))
+        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.assertTrue(result.data.startswith(b'<!DOCTYPE html'))
+        self.assertTrue(result.data.startswith(b'<!doctype html'))
         soup = bs4.BeautifulSoup(result.data, 'html.parser')
         self.assertEqual(soup.title.text, 'Rodelbahnen')
         table = soup.find('table')
@@ -136,21 +136,21 @@ class TestDbWradmin(WradminTestBase):
     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'))
+        self.assertTrue(result.data.startswith(b'<!doctype html'))
         soup = bs4.BeautifulSoup(result.data, 'html.parser')
-        self.assertEqual(soup.title.text, 'Rodelbahn')
+        self.assertIn('Rodelbahn', soup.title.text)
         self.assertIn('Hühnerspiel', str(soup))
 
     def test_rodelbahn_update(self):
         result = self.app.get('/rodelbahn/update', follow_redirects=True)
         self.assertEqual(result.status_code, 200)
-        self.assertTrue(result.data.startswith(b'<!DOCTYPE html'))
+        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', follow_redirects=True)
         self.assertEqual(result.status_code, 200)
-        self.assertTrue(result.data.startswith(b'<!DOCTYPE html'))
+        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))