mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
Fixed test for column sorting, refs #981
This commit is contained in:
parent
ae1f7c3870
commit
97c71c3a3b
1 changed files with 36 additions and 8 deletions
|
|
@ -343,24 +343,52 @@ def test_sort_links(app_client):
|
||||||
for th in ths
|
for th in ths
|
||||||
]
|
]
|
||||||
assert [
|
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",
|
"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",
|
"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",
|
"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",
|
"a_href": "sortable?_sort=text",
|
||||||
},
|
},
|
||||||
] == attrs_and_link_attrs
|
] == attrs_and_link_attrs
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue