mirror of https://github.com/apache/superset.git
parent
256a521bf1
commit
e834154030
|
@ -1374,7 +1374,7 @@ class Superset(BaseSupersetView):
|
||||||
.get('connect_args', {}))
|
.get('connect_args', {}))
|
||||||
engine = create_engine(uri, connect_args=connect_args)
|
engine = create_engine(uri, connect_args=connect_args)
|
||||||
engine.connect()
|
engine.connect()
|
||||||
return json.dumps(engine.table_names(), indent=4)
|
return json_success(json.dumps(engine.table_names(), indent=4))
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logging.exception(e)
|
logging.exception(e)
|
||||||
return json_error_response((
|
return json_error_response((
|
||||||
|
|
|
@ -284,6 +284,7 @@ class CoreTests(SupersetTestCase):
|
||||||
})
|
})
|
||||||
response = self.client.post('/superset/testconn', data=data, content_type='application/json')
|
response = self.client.post('/superset/testconn', data=data, content_type='application/json')
|
||||||
assert response.status_code == 200
|
assert response.status_code == 200
|
||||||
|
assert response.headers['Content-Type'] == 'application/json'
|
||||||
|
|
||||||
# validate that the endpoint works with the decrypted sqlalchemy uri
|
# validate that the endpoint works with the decrypted sqlalchemy uri
|
||||||
data = json.dumps({
|
data = json.dumps({
|
||||||
|
@ -292,6 +293,7 @@ class CoreTests(SupersetTestCase):
|
||||||
})
|
})
|
||||||
response = self.client.post('/superset/testconn', data=data, content_type='application/json')
|
response = self.client.post('/superset/testconn', data=data, content_type='application/json')
|
||||||
assert response.status_code == 200
|
assert response.status_code == 200
|
||||||
|
assert response.headers['Content-Type'] == 'application/json'
|
||||||
|
|
||||||
def test_databaseview_edit(self, username='admin'):
|
def test_databaseview_edit(self, username='admin'):
|
||||||
# validate that sending a password-masked uri does not over-write the decrypted uri
|
# validate that sending a password-masked uri does not over-write the decrypted uri
|
||||||
|
|
Loading…
Reference in New Issue