AAfghahi commented on a change in pull request #14451:
URL: https://github.com/apache/superset/pull/14451#discussion_r630524883
##########
File path: tests/databases/api_tests.py
##########
@@ -241,6 +242,34 @@ def test_create_database(self):
db.session.delete(model)
db.session.commit()
+ def test_create_database_invalid_configuration_method(self):
+ """
+ Database API: Test create
+ """
+ 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,
+ "configuration_method": "BAD_FORM",
+ "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"))
+ self.assertEqual(rv.status_code, 400)
Review comment:
ok will do, ty
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]