removed reliance on built-in django ModelForms from templates/core/base.html, apps.dashboard.forms, .tests.test_forms & .test_views

This commit is contained in:
Disco DeDisco
2026-01-24 13:36:31 -05:00
parent 0afc5ee8d7
commit 6627042b7a
4 changed files with 31 additions and 47 deletions

View File

@@ -50,7 +50,7 @@ class NewListTest(TestCase):
response = self.post_invalid_input()
self.assertContains(response, html.escape(EMPTY_ITEM_ERROR))
class DashViewTest(TestCase):
class ListViewTest(TestCase):
def test_uses_list_template(self):
mylist = List.objects.create()
response = self.client.get(f'/apps/dashboard/{mylist.id}/')
@@ -122,6 +122,12 @@ class DashViewTest(TestCase):
response = self.post_invalid_input()
self.assertContains(response, html.escape(EMPTY_ITEM_ERROR))
def test_for_invalid_input_sets_is_invalid_class(self):
response = self.post_invalid_input()
parsed = lxml.html.fromstring(response.content)
[input] = parsed.cssselect("input[name=text]")
self.assertIn("is-invalid", set(input.classes))
def test_duplicate_item_validation_errors_end_up_on_lists_page(self):
list1 = List.objects.create()
Item.objects.create(list=list1, text="lorem ipsum")