kopia lustrzana https://github.com/simonw/datasette
Fixed crash on /:memory: page
rodzic
9617e92aa8
commit
ec2db345e9
|
@ -149,6 +149,8 @@ class ConnectedDatabase:
|
|||
|
||||
@property
|
||||
def size(self):
|
||||
if self.is_memory:
|
||||
return 0
|
||||
if self.cached_size is not None:
|
||||
return self.cached_size
|
||||
else:
|
||||
|
|
|
@ -19,6 +19,11 @@ def test_homepage(app_client):
|
|||
assert "fixtures" in response.text
|
||||
|
||||
|
||||
def test_memory_database_page(app_client_with_memory):
|
||||
response = app_client_with_memory.get("/:memory:")
|
||||
assert response.status == 200
|
||||
|
||||
|
||||
def test_database_page_redirects_with_url_hash(app_client_with_hash):
|
||||
response = app_client_with_hash.get("/fixtures", allow_redirects=False)
|
||||
assert response.status == 302
|
||||
|
|
Ładowanie…
Reference in New Issue