mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
fix: tilde encode database name in expanded foreign key links (#2476)
* Tilde encode database for expanded foreign key links * Test for foreign key fix in #2476 --------- Co-authored-by: Simon Willison <swillison@gmail.com>
This commit is contained in:
parent
f2485dce9c
commit
d5c6e502fb
2 changed files with 8 additions and 1 deletions
|
|
@ -3,6 +3,7 @@ from bs4 import BeautifulSoup as Soup
|
|||
from .fixtures import ( # noqa
|
||||
app_client,
|
||||
make_app_client,
|
||||
app_client_with_dot,
|
||||
)
|
||||
import pathlib
|
||||
import pytest
|
||||
|
|
@ -1291,3 +1292,9 @@ async def test_foreign_key_labels_obey_permissions(config):
|
|||
"rows": [{"id": 1, "name": "world", "a_id": 1}],
|
||||
"truncated": False,
|
||||
}
|
||||
|
||||
|
||||
def test_foreign_keys_special_character_in_database_name(app_client_with_dot):
|
||||
# https://github.com/simonw/datasette/pull/2476
|
||||
response = app_client_with_dot.get("/fixtures~2Edot/complex_foreign_keys")
|
||||
assert '<a href="/fixtures~2Edot/simple_primary_key/2">world</a>' in response.text
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue