Esempio n. 1
0
 def test_teamContent(self):
     """initial test. ensure flask was set up correctly"""
     tester = app.test_client(self)
     response = tester.get('/team', content_type='html/text')
     htmlString = response.data.decode("utf-8")
     html = BeautifulSoup(htmlString, "lxml")
     self.assertTrue("Built by two best friends!" in html.h1.text)
Esempio n. 2
0
 def test_aboutContent(self):
     """initial test. ensure flask was set up correctly"""
     tester = app.test_client(self)
     response = tester.get('/about', content_type='html/text')
     htmlString = response.data.decode("utf-8")
     html = BeautifulSoup(htmlString, "lxml")
     self.assertTrue("All about our restaurant" in html.h1.text)
Esempio n. 3
0
 def test_homeContenthasH1(self):
     """initial test. ensure flask was set up correctly"""
     tester = app.test_client(self)
     response = tester.get('/', content_type='html/text')
     htmlString = response.data.decode("utf-8")
     html = BeautifulSoup(htmlString, "lxml")
     self.assertTrue("Welcome!" in html.h1.text, "Welcome! in h1 tag")
Esempio n. 4
0
 def test_homepageLinksToTeam(self):
     """Ensure About link points to team page"""
     tester = app.test_client(self)
     response = tester.get('/', content_type='html/text')
     htmlString = response.data.decode("utf-8")
     html = BeautifulSoup(htmlString, "lxml")
     element = html.find('a', text="About")
     self.assertTrue(html.find('a', {"href": "/team"}).text == "Team")
Esempio n. 5
0
 def test_homepageLinksToTeam(self):
     """Ensure there is a link with text Team"""
     tester = app.test_client(self)
     response = tester.get('/', content_type='html/text')
     htmlString = response.data.decode("utf-8")
     html = BeautifulSoup(htmlString, "lxml")
     element = html.find('a', text="Team")
     self.assertTrue(element != None)
Esempio n. 6
0
 def test_home(self):
     """initial test. ensure flask was set up correctly"""
     tester = app.test_client(self)
     response = tester.get('/', content_type='html/text')
     htmlString = response.data.decode("utf-8")
     self.assertEqual(response.status_code, 200)
Esempio n. 7
0
 def test_homeContent(self):
     """initial test. ensure flask was set up correctly"""
     tester = app.test_client(self)
     response = tester.get('/', content_type='html/text')
     htmlString = response.data.decode("utf-8")
     self.assertTrue("Welcome!" in htmlString)
Esempio n. 8
0
 def test_teamPage(self):
     """initial test. ensure flask was set up correctly"""
     tester = app.test_client(self)
     response = tester.get('/team', content_type='html/text')
     htmlString = response.data.decode("utf-8")
     self.assertEqual(htmlString, "Built by two best friends!")
Esempio n. 9
0
 def test_aboutPage(self):
     """initial test. ensure flask was set up correctly"""
     tester = app.test_client(self)
     response = tester.get('/about', content_type='html/text')
     htmlString = response.data.decode("utf-8")
     self.assertEqual(htmlString, "A family owned restaurant!")