diff --git a/apps/dashboard/tests.py b/apps/dashboard/tests.py index d342526..8a85b66 100644 --- a/apps/dashboard/tests.py +++ b/apps/dashboard/tests.py @@ -41,24 +41,32 @@ class ListAndItemModelsTest(TestCase): class DashViewTest(TestCase): def test_uses_list_template(self): - response = self.client.get('/apps/dashboard/the-only-list-in-the-world/') + mylist = List.objects.create() + response = self.client.get(f'/apps/dashboard/{mylist.id}/') 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, '
') + mylist = List.objects.create() + response = self.client.get(f'/apps/dashboard/{mylist.id}/') + self.assertContains( + response, + f'', + ) self.assertContains(response, '/', views.view_list, name='view_list'), + path('apps/dashboard//add-item', views.add_item, name='add_item'), ] diff --git a/templates/apps/dashboard/list.html b/templates/apps/dashboard/list.html index 58585ad..61a1703 100644 --- a/templates/apps/dashboard/list.html +++ b/templates/apps/dashboard/list.html @@ -4,7 +4,7 @@

Your To-Do List

- + {% csrf_token %}