mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
Merge branch 'database-spaces' into datasette-library-simple
This commit is contained in:
commit
9c46f2f21f
3 changed files with 13 additions and 0 deletions
|
|
@ -203,6 +203,8 @@ class DataView(BaseView):
|
|||
hash = None
|
||||
else:
|
||||
name = db_name
|
||||
if "%" in name:
|
||||
name = urllib.parse.unquote_plus(name)
|
||||
# Verify the hash
|
||||
try:
|
||||
db = self.ds.databases[name]
|
||||
|
|
|
|||
|
|
@ -217,6 +217,11 @@ def app_client_with_dot():
|
|||
yield from make_app_client(filename="fixtures.dot.db")
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def app_client_with_space():
|
||||
yield from make_app_client(filename="fixtures with space.db")
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def app_client_with_cors():
|
||||
yield from make_app_client(cors=True)
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ from .fixtures import ( # noqa
|
|||
app_client_two_attached_databases_one_immutable,
|
||||
app_client_with_cors,
|
||||
app_client_with_dot,
|
||||
app_client_with_space,
|
||||
generate_compound_rows,
|
||||
generate_sortable_rows,
|
||||
make_app_client,
|
||||
|
|
@ -544,6 +545,11 @@ def test_database_page_for_database_with_dot_in_name(app_client_with_dot):
|
|||
assert 200 == response.status
|
||||
|
||||
|
||||
def test_database_page_for_database_with_space_in_name(app_client_with_space):
|
||||
response = app_client_with_space.get("/fixtures%20with%20space.json")
|
||||
assert 200 == response.status
|
||||
|
||||
|
||||
def test_custom_sql(app_client):
|
||||
response = app_client.get(
|
||||
"/fixtures.json?sql=select+content+from+simple_primary_key&_shape=objects"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue