From 238e6c15bc51143f8f62d0de9b304db6ab4c8b56 Mon Sep 17 00:00:00 2001 From: Chris Clark Date: Wed, 14 Aug 2024 09:43:40 -0400 Subject: [PATCH] tests --- explorer/ee/db_connections/utils.py | 1 - explorer/tests/test_views.py | 4 ++-- explorer/views/utils.py | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/explorer/ee/db_connections/utils.py b/explorer/ee/db_connections/utils.py index 68649dc8..c50306ed 100644 --- a/explorer/ee/db_connections/utils.py +++ b/explorer/ee/db_connections/utils.py @@ -16,7 +16,6 @@ def default_db_connection_id(): return default_db_connection().id - # Uploading the same filename twice (from the same user) will overwrite the 'old' DB on S3 def upload_sqlite(db_bytes, path): from explorer.utils import get_s3_bucket diff --git a/explorer/tests/test_views.py b/explorer/tests/test_views.py index 387f1bd0..59250f4d 100644 --- a/explorer/tests/test_views.py +++ b/explorer/tests/test_views.py @@ -652,14 +652,14 @@ def setUp(self): def test_returns_schema_contents(self): resp = self.client.get( - reverse("explorer_schema", kwargs={"connection": default_db_connection().alias}) + reverse("explorer_schema", kwargs={"connection": default_db_connection().id}) ) self.assertContains(resp, "explorer_query") self.assertTemplateUsed(resp, "explorer/schema.html") def test_returns_schema_contents_json(self): resp = self.client.get( - reverse("explorer_schema_json", kwargs={"connection": default_db_connection().alias}) + reverse("explorer_schema_json", kwargs={"connection": default_db_connection().id}) ) self.assertContains(resp, "explorer_query") self.assertEqual(resp.headers["Content-Type"], "application/json") diff --git a/explorer/views/utils.py b/explorer/views/utils.py index 1ee89ebd..a01f2528 100644 --- a/explorer/views/utils.py +++ b/explorer/views/utils.py @@ -84,6 +84,6 @@ def query_viewmodel(request, query, title=None, form=None, message=None, "charts_enabled": app_settings.EXPLORER_CHARTS_ENABLED, "is_favorite": is_favorite, "show_sql_by_default": app_settings.EXPLORER_SHOW_SQL_BY_DEFAULT, - "schema_json": schema_json_info(query.database_connection if query else None), + "schema_json": schema_json_info(query.database_connection) if query and query.database_connection else None, } return {**ret, **charts}