Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: fixing api tests for database connections #15124

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion superset/databases/schemas.py
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ class Meta: # pylint: disable=too-few-public-methods
configuration_method = EnumField(
ConfigurationMethod,
by_value=True,
allow_none=True,
required=True,
description=configuration_method_description,
)

Expand Down
2 changes: 1 addition & 1 deletion superset/db_engine_specs/bigquery.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@

class BigQueryParametersSchema(Schema):
credentials_info = EncryptedField(
description="Contents of BigQuery JSON credentials.",
required=True, description="Contents of BigQuery JSON credentials.",
)


Expand Down
31 changes: 0 additions & 31 deletions tests/databases/api_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -278,37 +278,6 @@ def test_create_database_invalid_configuration_method(self):
}
assert rv.status_code == 400

# add this test back in when config method becomes required for creation.
# def test_create_database_no_configuration_method(self):
# """
# Database API: Test create with no config method.
# """
# extra = {
# "metadata_params": {},
# "engine_params": {},
# "metadata_cache_timeout": {},
# "schemas_allowed_for_csv_upload": [],
# }

# self.login(username="admin")
# example_db = get_example_database()
# if example_db.backend == "sqlite":
# return
# database_data = {
# "database_name": "test-create-database",
# "sqlalchemy_uri": example_db.sqlalchemy_uri_decrypted,
# "server_cert": None,
# "extra": json.dumps(extra),
# }

# uri = "api/v1/database/"
# rv = self.client.post(uri, json=database_data)
# response = json.loads(rv.data.decode("utf-8"))
# assert response == {
# "message": {"configuration_method": ["Missing data for required field."]}
# }
# assert rv.status_code == 400

def test_create_database_server_cert_validate(self):
"""
Database API: Test create server cert validation
Expand Down