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:
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user