From 153e36c790b0f9fc539ab124e851c70862c32037 Mon Sep 17 00:00:00 2001 From: JasonHomeWorkstationUbuntu Date: Wed, 11 Nov 2020 00:07:25 +1100 Subject: [PATCH] 7.5 Taking a First, Self-Contained Step: One New URL --- src/lists/tests.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/lists/tests.py b/src/lists/tests.py index 10a554c..83eda0f 100644 --- a/src/lists/tests.py +++ b/src/lists/tests.py @@ -43,6 +43,16 @@ class HomePageTest(TestCase): self.assertIn('itemey 1', 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):