Example #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)
Example #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)
Example #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")
Example #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")
Example #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)
Example #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)
Example #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)
Example #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!")
Example #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!")