mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
parent
fd2a74dc09
commit
2c0e1e09bc
2 changed files with 27 additions and 5 deletions
|
|
@ -462,7 +462,7 @@ def test_table_html_simple_primary_key(app_client):
|
|||
table = Soup(response.body, "html.parser").find("table")
|
||||
assert table["class"] == ["rows-and-columns"]
|
||||
ths = table.findAll("th")
|
||||
assert "id" == ths[0].find("a").string.strip()
|
||||
assert "id\xa0▼" == ths[0].find("a").string.strip()
|
||||
for expected_col, th in zip(("content",), ths[1:]):
|
||||
a = th.find("a")
|
||||
assert expected_col == a.string
|
||||
|
|
@ -582,6 +582,15 @@ def test_table_html_no_primary_key(app_client):
|
|||
]
|
||||
|
||||
|
||||
def test_rowid_sortable_no_primary_key(app_client):
|
||||
response = app_client.get("/fixtures/no_primary_key")
|
||||
assert response.status == 200
|
||||
table = Soup(response.body, "html.parser").find("table")
|
||||
assert table["class"] == ["rows-and-columns"]
|
||||
ths = table.findAll("th")
|
||||
assert "rowid\xa0▼" == ths[1].find("a").string.strip()
|
||||
|
||||
|
||||
def test_row_html_no_primary_key(app_client):
|
||||
response = app_client.get("/fixtures/no_primary_key/1")
|
||||
assert response.status == 200
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue