diff options
| author | Tim Graham <timograham@gmail.com> | 2015-12-28 15:31:45 -0500 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2016-02-02 10:22:59 -0500 |
| commit | 37f7ef41fbaebd5f545b99a11ab6036d92f9232b (patch) | |
| tree | 0e3cad21f2e7827278cf54a1cd959abfcae24061 /tests/admin_views/tests.py | |
| parent | 1e9150443e5696d764ed81c97b53ef0365a5d854 (diff) | |
Fixed #24316 -- Made ModelAdmin.list_display callables use an appropriate CSS class name.
Thanks Berker Peksag for the review.
Diffstat (limited to 'tests/admin_views/tests.py')
| -rw-r--r-- | tests/admin_views/tests.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/admin_views/tests.py b/tests/admin_views/tests.py index 22a5d87231..55ff3c5c08 100644 --- a/tests/admin_views/tests.py +++ b/tests/admin_views/tests.py @@ -344,6 +344,15 @@ class AdminViewBasicTest(AdminViewBasicTestCase): # started with 3 articles, one was deleted. self.assertEqual(Section.objects.latest('id').article_set.count(), 2) + def test_change_list_column_field_classes(self): + response = self.client.get(reverse('admin:admin_views_article_changelist')) + # callables display the callable name. + self.assertContains(response, 'column-callable_year') + self.assertContains(response, 'field-callable_year') + # lambdas display as "lambda" + index that they appear in list_display. + self.assertContains(response, 'column-lambda8') + self.assertContains(response, 'field-lambda8') + def test_change_list_sorting_callable(self): """ Ensure we can sort on a list_display field that is a callable |
