Skip to content

Commit

Permalink
tests
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisclark committed Aug 14, 2024
1 parent 4c50e6e commit 238e6c1
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
1 change: 0 additions & 1 deletion explorer/ee/db_connections/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions explorer/tests/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
2 changes: 1 addition & 1 deletion explorer/views/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}

0 comments on commit 238e6c1

Please sign in to comment.