Ejemplo 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)
Ejemplo 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)
Ejemplo 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")
Ejemplo 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")
Ejemplo 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)
Ejemplo 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)
Ejemplo 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)
Ejemplo 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!")
Ejemplo 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!")