diff options
| author | Jani Tiainen <jani@tiainen.cc> | 2019-03-19 17:51:35 +0200 |
|---|---|---|
| committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2019-03-24 20:43:56 +0100 |
| commit | 044cc544203fdcf2601ff200547ecae2e51a5db5 (patch) | |
| tree | 7d49cb5ff82b7368e39456752ceab3ec8bc480bd /tests/admin_views/tests.py | |
| parent | ea60b7bc7464808e34e3cb0aac04455fdd8545eb (diff) | |
Fixed #30259 -- Added support for admin_order_field attribute on properties in ModelAdmin.list_display.
Diffstat (limited to 'tests/admin_views/tests.py')
| -rw-r--r-- | tests/admin_views/tests.py | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/admin_views/tests.py b/tests/admin_views/tests.py index 3acbc3d7ed..87835eb37b 100644 --- a/tests/admin_views/tests.py +++ b/tests/admin_views/tests.py @@ -344,6 +344,25 @@ class AdminViewBasicTest(AdminViewBasicTestCase): "Results of sorting on callable are out of order." ) + def test_change_list_sorting_property(self): + """ + Sort on a list_display field that is a property (column 10 is + a property in Article model). + """ + response = self.client.get(reverse('admin:admin_views_article_changelist'), {'o': 10}) + self.assertContentBefore( + response, + 'Oldest content', + 'Middle content', + 'Results of sorting on property are out of order.', + ) + self.assertContentBefore( + response, + 'Middle content', + 'Newest content', + 'Results of sorting on property are out of order.', + ) + def test_change_list_sorting_callable_query_expression(self): """ Query expressions may be used for admin_order_field. (column 9 is |
