From 61c2c1bcb3bcfdadb8cb2d02b3c509d3228229ee Mon Sep 17 00:00:00 2001 From: Disco DeDisco Date: Fri, 2 Jan 2026 19:50:27 -0500 Subject: [PATCH] created apps/dashboard/list.html template (for now, mirrors home.html); changes ListViewTest() to DashViewTest() in apps.dashboard.tests; added new list template test to same; updated view_list() FBV in .views to accomodate this new template --- apps/dashboard/tests.py | 6 +++++- apps/dashboard/views.py | 2 +- templates/apps/dashboard/list.html | 17 +++++++++++++++++ 3 files changed, 23 insertions(+), 2 deletions(-) create mode 100644 templates/apps/dashboard/list.html diff --git a/apps/dashboard/tests.py b/apps/dashboard/tests.py index 7bba493..9b5bbb0 100644 --- a/apps/dashboard/tests.py +++ b/apps/dashboard/tests.py @@ -44,7 +44,11 @@ class ItemModelTest(TestCase): self.assertEqual(first_saved_item.text, "The first (ever) list item") self.assertEqual(second_saved_item.text, "A sequel somehow better than the first") -class ListViewTest(TestCase): +class DashViewTest(TestCase): + def test_uses_list_template(self): + response = self.client.get('/apps/dashboard/the-only-list-in-the-world/') + self.assertTemplateUsed(response, 'apps/dashboard/list.html') + def test_renders_input_form(self): response = self.client.get('/apps/dashboard/the-only-list-in-the-world/') self.assertContains(response, '
+ + To-Do lists + + +

Your To-Do List

+ + + {% csrf_token %} +
+ + {% for item in items %} + + {% endfor %} +
{{ forloop.counter }}. {{ item.text }}
+ + \ No newline at end of file