コード例 #1
0
 def test_cv_page_returns_correct_html(self):
     request = HttpRequest()
     response = cv_page(request)
     html = response.content.decode('utf8')
     self.assertTrue(html.startswith("\n<html>"))
     self.assertIn('<title> Bridging Coursework </title>', html)
     self.assertTrue(html.endswith('</html>'))
コード例 #2
0
 def test_cv_page_returns_correct_html(self):
     request = HttpRequest()
     response = cv_page(request)
     html = response.content.decode('utf-8')
     self.assertTrue(html.startswith('\n<html>'))
     self.assertIn("<title>Thomas Mills</title>", html)
     self.assertTrue(html.endswith('</html>'))
コード例 #3
0
 def test_each_entry_displays_correctly(self):
     request = HttpRequest()
     response = cv_page(request)
     html = response.content.decode('utf-8')
     for entry in CVEntry.objects.all():
         self.assertIn(entry.title, html)
         self.assertIn(entry.text, html)
         self.assertNotIn(entry.author, html)
         self.assertNotIn(entry.created_date, html)
         self.assertNotIn(entry.pk, html)
         self.assertNotIn(entry.published_date, html)
コード例 #4
0
 def test_cv_page_contains_a_skills_section(self):
     request = HttpRequest()
     response = cv_page(request)
     html = response.content.decode('utf8')
     self.assertIn('<h4>SKILLS</h4>', html)
コード例 #5
0
 def test_cv_page_contains_a_career_section(self):
     request = HttpRequest()
     response = cv_page(request)
     html = response.content.decode('utf8')
     self.assertIn('<h4>CAREER HISTORY</h4>', html)
コード例 #6
0
 def test_cv_page_contains_a_eduction_section(self):
     request = HttpRequest()
     response = cv_page(request)
     html = response.content.decode('utf8')
     self.assertIn('<h4>EDUCATION</h4>', html)
コード例 #7
0
 def test_cv_page_returns_correct_title(self):
     request = HttpRequest()
     response = cv_page(request)
     html = response.content.decode('utf8')
     self.assertIn('<title>Anandbir\'s Website</title>', html)
コード例 #8
0
 def test_cv_page_returns_correct_html(self):
     request = HttpRequest()
     response = cv_page(request)
     html = response.content.decode('utf8')
     self.assertIn('<div class="cv">', html)
     self.assertTrue(html.endswith('</html>'))