|
@@ -667,6 +667,7 @@ class TestListViewWithCustomColumns(BaseSnippetViewSetTests):
|
|
|
self.assertContains(response, "Custom FOO column")
|
|
|
self.assertContains(response, "Updated")
|
|
|
self.assertContains(response, "Modulo two")
|
|
|
+ self.assertContains(response, "Tristate")
|
|
|
|
|
|
self.assertContains(response, "Foo UK")
|
|
|
|
|
@@ -678,14 +679,57 @@ class TestListViewWithCustomColumns(BaseSnippetViewSetTests):
|
|
|
|
|
|
html = response.content.decode()
|
|
|
|
|
|
- # The bulk actions column plus 5 columns defined in FullFeaturedSnippetViewSet
|
|
|
- self.assertTagInHTML("<th>", html, count=6, allow_extra_attrs=True)
|
|
|
+ # The bulk actions column plus 6 columns defined in FullFeaturedSnippetViewSet
|
|
|
+ self.assertTagInHTML("<th>", html, count=7, allow_extra_attrs=True)
|
|
|
|
|
|
def test_falsy_value(self):
|
|
|
# https://github.com/wagtail/wagtail/issues/10765
|
|
|
response = self.get()
|
|
|
self.assertContains(response, "<td>0</td>", html=True, count=1)
|
|
|
|
|
|
+ def test_boolean_column(self):
|
|
|
+ self.model.objects.create(text="Another one")
|
|
|
+ response = self.get()
|
|
|
+ self.assertContains(
|
|
|
+ response,
|
|
|
+ """
|
|
|
+ <td>
|
|
|
+ <svg class="icon icon-success default w-text-positive-100" aria-hidden="true">
|
|
|
+ <use href="#icon-success"></use>
|
|
|
+ </svg>
|
|
|
+ <span class="visuallyhidden">True</span>
|
|
|
+ </td>
|
|
|
+ """,
|
|
|
+ html=True,
|
|
|
+ count=1,
|
|
|
+ )
|
|
|
+ self.assertContains(
|
|
|
+ response,
|
|
|
+ """
|
|
|
+ <td>
|
|
|
+ <svg class="icon icon-error default w-text-critical-100" aria-hidden="true">
|
|
|
+ <use href="#icon-error"></use>
|
|
|
+ </svg>
|
|
|
+ <span class="visuallyhidden">False</span>
|
|
|
+ </td>
|
|
|
+ """,
|
|
|
+ html=True,
|
|
|
+ count=1,
|
|
|
+ )
|
|
|
+ self.assertContains(
|
|
|
+ response,
|
|
|
+ """
|
|
|
+ <td>
|
|
|
+ <svg class="icon icon-help default" aria-hidden="true">
|
|
|
+ <use href="#icon-help"></use>
|
|
|
+ </svg>
|
|
|
+ <span class="visuallyhidden">None</span>
|
|
|
+ </td>
|
|
|
+ """,
|
|
|
+ html=True,
|
|
|
+ count=1,
|
|
|
+ )
|
|
|
+
|
|
|
|
|
|
class TestListExport(BaseSnippetViewSetTests):
|
|
|
model = FullFeaturedSnippet
|