From 97c71c3a3b2916bffa6081995ebccc2fa137c6d5 Mon Sep 17 00:00:00 2001 From: Simon Willison Date: Wed, 30 Sep 2020 14:51:10 -0700 Subject: [PATCH] Fixed test for column sorting, refs #981 --- tests/test_html.py | 44 ++++++++++++++++++++++++++++++++++++-------- 1 file changed, 36 insertions(+), 8 deletions(-) diff --git a/tests/test_html.py b/tests/test_html.py index 4c57bfce..85155a8e 100644 --- a/tests/test_html.py +++ b/tests/test_html.py @@ -343,24 +343,52 @@ def test_sort_links(app_client): for th in ths ] assert [ - {"attrs": {"class": ["col-Link"], "scope": "col"}, "a_href": None}, - {"attrs": {"class": ["col-pk1"], "scope": "col"}, "a_href": None}, - {"attrs": {"class": ["col-pk2"], "scope": "col"}, "a_href": None}, - {"attrs": {"class": ["col-content"], "scope": "col"}, "a_href": None}, { - "attrs": {"class": ["col-sortable"], "scope": "col"}, + "attrs": {"class": ["col-Link"], "data-column": "Link", "scope": "col"}, + "a_href": None, + }, + { + "attrs": {"class": ["col-pk1"], "data-column": "pk1", "scope": "col"}, + "a_href": None, + }, + { + "attrs": {"class": ["col-pk2"], "data-column": "pk2", "scope": "col"}, + "a_href": None, + }, + { + "attrs": { + "class": ["col-content"], + "data-column": "content", + "scope": "col", + }, + "a_href": None, + }, + { + "attrs": { + "class": ["col-sortable"], + "data-column": "sortable", + "scope": "col", + }, "a_href": "sortable?_sort_desc=sortable", }, { - "attrs": {"class": ["col-sortable_with_nulls"], "scope": "col"}, + "attrs": { + "class": ["col-sortable_with_nulls"], + "data-column": "sortable_with_nulls", + "scope": "col", + }, "a_href": "sortable?_sort=sortable_with_nulls", }, { - "attrs": {"class": ["col-sortable_with_nulls_2"], "scope": "col"}, + "attrs": { + "class": ["col-sortable_with_nulls_2"], + "data-column": "sortable_with_nulls_2", + "scope": "col", + }, "a_href": "sortable?_sort=sortable_with_nulls_2", }, { - "attrs": {"class": ["col-text"], "scope": "col"}, + "attrs": {"class": ["col-text"], "data-column": "text", "scope": "col"}, "a_href": "sortable?_sort=text", }, ] == attrs_and_link_attrs