def test_post_list_returns_correct_html(self): request = HttpRequest() response = cv(request) html = response.content.decode('utf8') self.assertTrue(html.strip().startswith('<html>')) self.assertIn("<title>Canle's CV</title>", html) self.assertTrue(html.strip().endswith('</html>'))
def test_cv_page_returns_correct_html(self): request = HttpRequest() #A request object is what Django see's when the user #browser asks for a page. response = cv(request) #Pass it our cv page view, which gives us a response. html = response.content.decode('utf8') # self.assertTrue(html.startswith('<html>')) self.assertIn('<title>Cv Page</title>', html) self.assertTrue(html.strip().endswith('</html>'))
def test_coding_skills(self): request = HttpRequest() response = views.cv(request) html = response.content.decode('utf8') self.assertIn('<h3>Coding Skills</h3>', html)
def test_linkedin(self): request = HttpRequest() response = views.cv(request) html = response.content.decode('utf8') self.assertIn('linkedin.com', html)
def test_achievements(self): request = HttpRequest() response = views.cv(request) html = response.content.decode('utf8') self.assertIn('<h3>Other Achievements</h3>', html)
def test_email(self): request = HttpRequest() response = views.cv(request) html = response.content.decode('utf8') self.assertIn('*****@*****.**', html)
def test_contact_details(self): request = HttpRequest() response = views.cv(request) html = response.content.decode('utf8') self.assertIn('<h3>Contact Details</h3>', html)
def test_exists_header(self): request = HttpRequest() response = views.cv(request) html = response.content.decode('utf8') self.assertIn('<h1>Katie Potts\' Blog</h1>', html)
def test_html_match(self): request = HttpRequest() response = views.cv(request) html = response.content.decode('utf8') self.assertIn('<html>', html) self.assertIn('</html>', html)
def test_academic_record(self): request = HttpRequest() response = views.cv(request) html = response.content.decode('utf8') self.assertIn('<h3>Academics</h3>', html)