Url config. Map / to home_page view
This commit is contained in:
@@ -5,9 +5,7 @@ from lists.views import home_page
|
||||
# Create your tests here.
|
||||
class HomePageTest(TestCase):
|
||||
def test_home_page_returns_correct_html(self):
|
||||
request = HttpRequest()
|
||||
response = home_page(request)
|
||||
html = response.content.decode("utf8")
|
||||
self.assertIn("<title>To-Do lists</title>", html)
|
||||
self.assertTrue(html.startswith("<html>"))
|
||||
self.assertTrue(html.endswith("</html>"))
|
||||
response = self.client.get("/")
|
||||
self.assertContains(response, "<title>To-Do lists</title>")
|
||||
self.assertContains(response, "<html>")
|
||||
self.assertContains(response, "</html>")
|
Reference in New Issue
Block a user