Modified home page template. Added more FT and UT

This commit is contained in:
2024-10-23 18:30:47 -06:00
parent ceb22cdf90
commit 5cedbfe9ce
4 changed files with 31 additions and 8 deletions

View File

@@ -6,4 +6,9 @@ from lists.views import home_page
class HomePageTest(TestCase):
def test_uses_home_page_template(self):
response = self.client.get("/")
self.assertTemplateUsed(response, "home.html")
def test_can_save_a_POST_request(self):
response = self.client.post("/", data={"item_text": "A new list item"})
self.assertContains(response, "A new list item")
self.assertTemplateUsed(response, "home.html")