7.5 Taking a First, Self-Contained Step: One New URL

chap7-new
Jason Zhu 2020-11-11 00:07:25 +11:00
parent e59776035b
commit 153e36c790
1 changed files with 10 additions and 0 deletions

View File

@ -43,6 +43,16 @@ class HomePageTest(TestCase):
self.assertIn('itemey 1', response.content.decode()) self.assertIn('itemey 1', response.content.decode())
self.assertIn('itemey 2', response.content.decode()) self.assertIn('itemey 2', response.content.decode())
class ListViewTest(TestCase):
def test_displays_all_items(self):
Item.objects.create(text="itemey 1")
Item.objects.create(text="itemey 2")
response = self.client.get('/lists/the-only-list-in-the-world')
self.assertIn('itemey 1', response.content.decode())
self.assertIn('itemey 2', response.content.decode())
class ItemModelTest(TestCase): class ItemModelTest(TestCase):