mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
Unit test for binary data display, refs #442
This commit is contained in:
parent
d555baf508
commit
01b3de5b66
4 changed files with 41 additions and 2 deletions
|
|
@ -883,3 +883,19 @@ def test_extra_where_clauses(app_client):
|
|||
"/fixtures/facetable?_where=city_id%3D1",
|
||||
"/fixtures/facetable?_where=neighborhood%3D%27Dogpatch%27"
|
||||
] == hrefs
|
||||
|
||||
|
||||
def test_binary_data_display(app_client):
|
||||
response = app_client.get("/fixtures/binary_data")
|
||||
assert response.status == 200
|
||||
table = Soup(response.body, "html.parser").find("table")
|
||||
expected_tds = [
|
||||
[
|
||||
'<td class="col-Link"><a href="/fixtures/binary_data/1">1</a></td>',
|
||||
'<td class="col-rowid">1</td>',
|
||||
'<td class="col-data"><Binary\xa0data:\xa019\xa0bytes></td>'
|
||||
]
|
||||
]
|
||||
assert expected_tds == [
|
||||
[str(td) for td in tr.select("td")] for tr in table.select("tbody tr")
|
||||
]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue