Url config. Map / to home_page view

This commit is contained in:
2024-10-23 13:16:53 -06:00
parent 285725ffdd
commit 1e2cc408de
2 changed files with 6 additions and 8 deletions

View File

@@ -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>")