Fixed crash on /:memory: page

pull/458/head
Simon Willison 2019-05-05 14:01:14 -04:00
rodzic 9617e92aa8
commit ec2db345e9
2 zmienionych plików z 7 dodań i 0 usunięć

Wyświetl plik

@ -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:

Wyświetl plik

@ -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